Search Results

Search found 8588 results on 344 pages for 'thread abort'.

Page 105/344 | < Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >

  • Porting Windows socket program to Unix: Alternative for winsock32 APIs in unix

    - by Amita
    In Socket Programming, how will a Unix thread receive a Socket CLOSE event from a client if connection is closed? Are there any API's which will notify the unix thread about the CLOSE event received? As in Windows we have WSAEnumNetworkEvents API which gets the event notification for a specified socket descriptor. What will be the equivalent API used in the Unix socket programing? Please provide the help for the query.

    Read the article

  • Multithreading or task parallel library

    - by Bruce Adams
    I have an application which performs 30 independent tasks simultaneously using multithreading, each task retrieves data over http, performs a calculation and returns a result to the ui thread. Can I use tpl to perform the same tasks? Does tpl create 30 new threads and spread them over all the available cores, or does it just split the tasks over the available cores and use one thread per core? Will there be a performance boost using tpl over multithreading in this case?

    Read the article

  • Check whether the string is a unix timestamp

    - by RHPT
    I have a string and I need to find out whether it is a unix timestamp or not, how can I do that effectively? I found this thread via Google, but it doesn't come up with a very solid answer, I'm afraid. (And yes, I cribbed the question from the original poster on the aforementioned thread). http://www.sitepoint.com/forums/showthread.php?t=585963

    Read the article

  • Reslet with GWT and Tomcat Error

    - by Holograham
    I am getting this error on startup I am using GWT 2.0.3 and Reslet RC3 type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet adapter threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) root cause java.lang.NoSuchMethodError: org.restlet.Client.handle(Lorg/restlet/Request;)Lorg/restlet/Response; org.restlet.ext.servlet.ServerServlet.createComponent(ServerServlet.java:423) org.restlet.ext.servlet.ServerServlet.getComponent(ServerServlet.java:763) org.restlet.ext.servlet.ServerServlet.init(ServerServlet.java:881) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) java.lang.Thread.run(Thread.java:619) My web XML is as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <context-param> <param-name>org.restlet.clients</param-name> <param-value>CLAP FILE WAR</param-value> </context-param> <servlet> <servlet-name>adapter</servlet-name> <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> <init-param> <param-name>org.restlet.application</param-name> <param-value>com.tdc.Propspace.server.TestServerApplication</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>adapter</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> Any ideas what would cause this?

    Read the article

  • gdb : multithreading

    - by Arpit
    Hi Wish to know that I have a program which uses two threads I have put the break point in both the threads. While running the program under gdb I want to switch between the threads and make them run. (thread t1 is active and running and thread t2 hold on the breakpoint I want to stop T1 running and run the T2) Is there any way that I can schedule the threads in gdb. Thanks Arpit

    Read the article

  • How is spin lock implemented under the hood?

    - by httpinterpret
    This is a lock that can be held by only one thread of execution at a time. An attempt to acquire the lock by another thread of execution makes the latter loop until the lock is released. How does it handle the case when two threads try to acquire the lock exactly the same time? I think this question also applies to various of other mutex implementation.

    Read the article

  • How to achieve syncronization in loadbalanced multiserver environment

    - by Anoop
    Hi, I have to create a .net web application which would run on more than one front end server which are load balanced. Now I have to use some third party api which is not thread safe so only one thread should call the API at a time so I have to some use syncronization machanism like lock or mutex which provide syncronisation within the process and across the process in machine.Now will lock or mutex work in loadbalanced multiserver environment correctly? If not then is there any mechanism using which I can syncronise all the threads in all the machines??

    Read the article

  • Windows Service HTTPListener Memory Issue

    - by crawshaws
    Hi all, Im a complete novice to the "best practices" etc of writing in any code. I tend to just write it an if it works, why fix it. Well, this way of working is landing me in some hot water. I am writing a simple windows service to server a single webpage. (This service will be incorperated in to another project which monitors the services and some folders on a group of servers.) My problem is that whenever a request is recieved, the memory usage jumps up by a few K per request and keeps qoing up on every request. Now ive found that by putting GC.Collect in the mix it stops at a certain number but im sure its not meant to be used this way. I was wondering if i am missing something or not doing something i should to free up memory. Here is the code: Public Class SimpleWebService : Inherits ServiceBase 'Set the values for the different event log types. Public Const EVENT_ERROR As Integer = 1 Public Const EVENT_WARNING As Integer = 2 Public Const EVENT_INFORMATION As Integer = 4 Public listenerThread As Thread Dim HTTPListner As HttpListener Dim blnKeepAlive As Boolean = True Shared Sub Main() Dim ServicesToRun As ServiceBase() ServicesToRun = New ServiceBase() {New SimpleWebService()} ServiceBase.Run(ServicesToRun) End Sub Protected Overrides Sub OnStart(ByVal args As String()) If Not HttpListener.IsSupported Then CreateEventLogEntry("Windows XP SP2, Server 2003, or higher is required to " & "use the HttpListener class.") Me.Stop() End If Try listenerThread = New Thread(AddressOf ListenForConnections) listenerThread.Start() Catch ex As Exception CreateEventLogEntry(ex.Message) End Try End Sub Protected Overrides Sub OnStop() blnKeepAlive = False End Sub Private Sub CreateEventLogEntry(ByRef strEventContent As String) Dim sSource As String Dim sLog As String sSource = "Service1" sLog = "Application" If Not EventLog.SourceExists(sSource) Then EventLog.CreateEventSource(sSource, sLog) End If Dim ELog As New EventLog(sLog, ".", sSource) ELog.WriteEntry(strEventContent) End Sub Public Sub ListenForConnections() HTTPListner = New HttpListener HTTPListner.Prefixes.Add("http://*:1986/") HTTPListner.Start() Do While blnKeepAlive Dim ctx As HttpListenerContext = HTTPListner.GetContext() Dim HandlerThread As Thread = New Thread(AddressOf ProcessRequest) HandlerThread.Start(ctx) HandlerThread = Nothing Loop HTTPListner.Stop() End Sub Private Sub ProcessRequest(ByVal ctx As HttpListenerContext) Dim sb As StringBuilder = New StringBuilder sb.Append("<html><body><h1>Test My Service</h1>") sb.Append("</body></html>") Dim buffer() As Byte = Encoding.UTF8.GetBytes(sb.ToString) ctx.Response.ContentLength64 = buffer.Length ctx.Response.OutputStream.Write(buffer, 0, buffer.Length) ctx.Response.OutputStream.Close() ctx.Response.Close() sb = Nothing buffer = Nothing ctx = Nothing 'This line seems to keep the mem leak down 'System.GC.Collect() End Sub End Class Please feel free to critisise and tear the code apart but please BE KIND. I have admitted I dont tend to follow the best practice when it comes to coding.

    Read the article

  • ThreadPooler in Spring 2.5.6

    - by MiKu
    My application uses Spring 2.5.6. I have a service that creates explicit threads for some specific task. Triggering of this service call happens through quartz time scheduler. Question : While executing service calls, i want to use some sort of thread pooler that can return me thread instances. Is there any implementations that i can use in Spring?

    Read the article

  • Threading in C#.

    - by Harsha
    Hello All, I have created an array of threads and started all of them. How to know whether all threads have completed work. I don't want to use thread.wait or thread.join. Thanks in advance. -Harsha

    Read the article

  • Is NSXMLParser's parse method asynchronous

    - by Ben Guest
    Is NSXMLParser's parse method asynchronous? in other words if i have an NSXMLParse object and i call [someParseObject parse] from the main thread, will it block the main thread while it does it's thing? -Thanks for answering this seemingly noob question. -Ben

    Read the article

  • Help with httpcore NIO exception

    - by bruce dou
    I/O error: I/O dispatch worker terminated abnormally Exception in thread "Thread-1" java.lang.IllegalStateException: I/O reactor has been shut down at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.connect(DefaultConnectingIOReactor.java:190)

    Read the article

  • Portability of pthreads-win32 over various compilers.

    - by Artyom
    Hello, I'm using pthreads-win32 for portable threading support for windows. At least, according to the documentation pthreads-win32 should work with MSVC and even MSVC builds provided. But I don't know if the library is tested with latest MSVC compilers like MSVC-2008 and if it is supported under 64bit windows. Does anybody aware of any issues with this library? Note: Do not even try to recommend using Boost.Thread, I'm not interested in. And I'm familiar with Boost.Thread library

    Read the article

  • Performance implications of BeginInvoke

    - by AngryHacker
    I've inherited code where BeginInvoke is called from the main thread (not a background thread, which is usually the pattern). I am trying to understand what it actually does in this scenario. Does the method being called in the BeginInvoke get in line of messages that come down to the window? The docs say asynchronously, so that is my assumption. How does the framework prioritize when to kick off the method called by BeginInvoke?

    Read the article

  • crash in calloc

    - by mmd
    I'm trying to debug a program I wrote. I ran it inside gdb and I managed to catch a SIGABRT from inside calloc(). I'm completely confused about how this can arise. Can it be a bug in gcc or even libc?? More details: My program uses OpenMP. I ran it through valgrind in single-threaded mode with no errors. I also use mmap() to load a 40GB file, but I doubt that is relevant. Inside gdb, I'm running with 30 threads. Several identical runs (same input&CL) finished correctly, until the problematic one that I caught. On the surface this suggests there might be a race condition of some type. However, the SIGABRT comes from calloc() which is out of my control. Here is some relevant gdb output: (gdb) info threads [...] * 11 Thread 0x7ffff0056700 (LWP 73449) 0x00007ffff6a948a5 in raise () from /lib64/libc.so.6 [...] (gdb) thread 11 [Switching to thread 11 (Thread 0x7ffff0056700 (LWP 73449))]#0 0x00007ffff6a948a5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff6a948a5 in raise () from /lib64/libc.so.6 #1 0x00007ffff6a96085 in abort () from /lib64/libc.so.6 #2 0x00007ffff6ad1fe7 in __libc_message () from /lib64/libc.so.6 #3 0x00007ffff6ad7916 in malloc_printerr () from /lib64/libc.so.6 #4 0x00007ffff6adb79f in _int_malloc () from /lib64/libc.so.6 #5 0x00007ffff6adbdd6 in calloc () from /lib64/libc.so.6 #6 0x000000000040e87f in my_calloc (re=0x7fff2867ef10, st=0, options=0x632020) at gmapper/../gmapper/../common/my-alloc.h:286 #7 read_get_hit_list_per_strand (re=0x7fff2867ef10, st=0, options=0x632020) at gmapper/mapping.c:1046 #8 0x000000000041308a in read_get_hit_list (re=<value optimized out>, options=0x632010, n_options=1) at gmapper/mapping.c:1239 #9 handle_read (re=<value optimized out>, options=0x632010, n_options=1) at gmapper/mapping.c:1806 #10 0x0000000000404f35 in launch_scan_threads (.omp_data_i=<value optimized out>) at gmapper/gmapper.c:557 #11 0x00007ffff7230502 in ?? () from /usr/lib64/libgomp.so.1 #12 0x00007ffff6dfc851 in start_thread () from /lib64/libpthread.so.0 #13 0x00007ffff6b4a11d in clone () from /lib64/libc.so.6 (gdb) f 6 #6 0x000000000040e87f in my_calloc (re=0x7fff2867ef10, st=0, options=0x632020) at gmapper/../gmapper/../common/my-alloc.h:286 286 res = calloc(size, 1); (gdb) p size $2 = 814080 (gdb) The function my_calloc() is just a wrapper, but the problem is not in there, as the real calloc() call looks legit. These are the limits set in the shell: $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 2067285 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited The program is not out of memory, it's using 41GB on a machine with 256GB available: $ top -b -n 1 | grep gmapper 73437 user 20 0 41.5g 16g 15g T 0.0 6.6 55:17.24 gmapper-ls $ free -m total used free shared buffers cached Mem: 258437 195567 62869 0 82 189677 -/+ buffers/cache: 5807 252629 Swap: 0 0 0 I compiled using gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4), with flags -g -O2 -DNDEBUG -mmmx -msse -msse2 -fopenmp -Wall -Wno-deprecated -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS.

    Read the article

  • RegRestoreKey problem

    - by Xaver
    i want to do part of program which save and load some data from registry. Saving is succefuly working. I have function GrabPrivilage to grant some privilegies to my thread. i grant SE_RESTORE_NAME and SE_BACKUP_NAME to my thread and after that i call RegRestoreKey(HKEY_LOCAL_MACHINE, TEXT("C:\reg.txt"), REG_FORCE_RESTORE ); and it always return ERROR_ACCESS_DENIED.

    Read the article

  • Multiple file descriptors to the same file, C

    - by Gigi
    I have a multithreaded application that is opening and reading the same file (not writing). I am opening a different file descriptor for each thread (but they all point to the same file). Each thread then reads the file and may close it and open it again if EOF is reached. Is this ok? If I perform fclose() on a file descriptor does it affect the other file descritptors that point to the same file?

    Read the article

  • controlling threads flow

    - by owca
    I had a task to write simple game simulating two players picking up 1-3 matches one after another until the pile is gone. I managed to do it for computer choosing random value of matches but now I'd like to go further and allow humans to play the game. Here's what I already have : http://paste.pocoo.org/show/201761/ Class Player is a computer player, and PlayerMan should be human being. Problem is, that thread of PlayerMan should wait until proper value of matches is given but I cannot make it work this way. Logic is as follows: thread runs until matches equals to zero. If player number is correct at the moment function pickMatches() is called. After decreasing number of matches on table, thread should wait and another thread should be notified. I know I must use wait() and notify() but I can't place them right. Class Shared keeps the value of current player, and also amount of matches. public void suspendThread() { suspended = true; } public void resumeThread() { suspended = false; } @Override public void run(){ int matches=1; int which = 0; int tmp=0; Shared data = this.selectData(); String name = this.returnName(); int number = this.getNumber(); while(data.getMatches() != 0){ while(!suspended){ try{ which = data.getCurrent(); if(number == which){ matches = pickMatches(); tmp = data.getMatches() - matches; data.setMatches(tmp, number); if(data.getMatches() == 0){ System.out.println(" "+ name+" takes "+matches+" matches."); System.out.println("Winner is player: "+name); stop(); } System.out.println(" "+ name+" takes "+matches+" matches."); if(number != 0){ data.setCurrent(0); } else{ data.setCurrent(1); } } this.suspendThread(); notifyAll(); wait(); }catch(InterruptedException exc) {} } } } @Override synchronized public int pickMatches(){ Scanner scanner = new Scanner(System.in); int n = 0; Shared data = this.selectData(); System.out.println("Choose amount of matches (from 1 to 3): "); if(data.getMatches() == 1){ System.out.println("There's only 1 match left !"); while(n != 1){ n = scanner.nextInt(); } } else{ do{ n = scanner.nextInt(); } while(n <= 1 && n >= 3); } return n; } }

    Read the article

  • Do .NET Timers Run Asynchronously?

    - by MrEdmundo
    I have a messaging aspect of my application using Jabber-net (an XMPP library.) What I would like to do, if for some reason the connection to the Server is ended, is keep trying to connect every minute or so. If I start a Timer to wait for a period of time before the next attempt, does that timer run asynchronously and the resulting Tick event join the main thread, or would I need to start my own thread and start the timer from within there?

    Read the article

  • Are "EXC_BREAKPOINT (SIGTRAP)" exceptions caused by debugging breakpoints?

    - by Dennis
    I have a multithreaded app that is very stable on all my test machines and seems to be stable for almost every one of my users (based on no complaints of crashes). The app crashes frequently for one user, though, who was kind enough to send crash reports. All the crash reports (~10 consecutive reports) look essentially identical: Date/Time: 2010-04-06 11:44:56.106 -0700 OS Version: Mac OS X 10.6.3 (10D573) Report Version: 6 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000002, 0x0000000000000000 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 com.apple.CoreFoundation 0x90ab98d4 __CFBasicHashRehash + 3348 1 com.apple.CoreFoundation 0x90adf610 CFBasicHashRemoveValue + 1264 2 com.apple.CoreText 0x94e0069c TCFMutableSet::Intersect(__CFSet const*) const + 126 3 com.apple.CoreText 0x94dfe465 TDescriptorSource::CopyMandatoryMatchableRequest(__CFDictionary const*, __CFSet const*) + 115 4 com.apple.CoreText 0x94dfdda6 TDescriptorSource::CopyDescriptorsForRequest(__CFDictionary const*, __CFSet const*, long (*)(void const*, void const*, void*), void*, unsigned long) const + 40 5 com.apple.CoreText 0x94e00377 TDescriptor::CreateMatchingDescriptors(__CFSet const*, unsigned long) const + 135 6 com.apple.AppKit 0x961f5952 __NSFontFactoryWithName + 904 7 com.apple.AppKit 0x961f54f0 +[NSFont fontWithName:size:] + 39 (....more text follows) First, I spent a long time investigating [NSFont fontWithName:size:]. I figured that maybe the user's fonts were screwed up somehow, so that [NSFont fontWithName:size:] was requesting something non-existent and failing for that reason. I added a bunch of code using [[NSFontManager sharedFontManager] availableFontNamesWithTraits:NSItalicFontMask] to check for font availability in advance. Sadly, these changes didn't fix the problem. I've now noticed that I forgot to remove some debugging breakpoints, including _NSLockError, [NSException raise], and objc_exception_throw. However, the app was definitely built using "Release" as the active build configuration. I assume that using the "Release" configuration prevents setting of any breakpoints--but then again I am not sure exactly how breakpoints work or whether the program needs to be run from within gdb for breakpoints to have any effect. My questions are: could my having left the breakpoints set be the cause of the crashes observed by the user? If so, why would the breakpoints cause a problem only for this one user? If not, has anybody else had similar problems with [NSFont fontWithName:size:]? I will probably just try removing the breakpoints and sending back to the user, but I'm not sure how much currency I have left with that user. And I'd like to understand more generally whether leaving the breakpoints set could possibly cause a problem (when the app is built using "Release" configuration).

    Read the article

  • Is there a CakePHP offline manual

    - by Leo
    There used to be, but there don't seem to be any direct links. A little digging around revealed some answers which I thought it would be useful to share. These are links to the manual in one page - useful for offline use or creating a PDF using Dardo Sordi Bogado's build script: http://rapidshare.com/files/218826372/manual-builder.zip 1.2 Manual in one page http://book.cakephp.org/complete/3/The-Manual 1.3 Manual in one page http://book.cakephp.org/complete/876/The-Manual Also see this thread: http://groups.google.com/group/cake-php/browse_thread/thread/5f45c1d0...

    Read the article

  • TThread.resume is deprecated in Delphi-2010 what should be used in place?

    - by Charles Faiga
    In my multithread application I use TThread.suspend and TThread.resume Since moving my application to Delphi 2010 I get the following warring message [DCC Warning] xxx.pas(277): W1000 Symbol ‘Resume’ is deprecated If Resume is deprecated what should be used in place? EDIT 1: I use the Resume command to start the thread - as it is Created with 'CreateSuspended' set to True and Suspend before I terminate the thread. EDIT 2: Here is a link the delphi 2010 manual

    Read the article

  • Some more multitasking java issues

    - by owca
    I had a task to write simple game simulating two players picking up 1-3 matches one after another until the pile is gone. I managed to do it for computer choosing random value of matches but now I'd like to go further and allow humans to play the game. Here's what I already have : http://paste.pocoo.org/show/200660/ Class Player is a computer player, and PlayerMan should be human being. Problem is, that thread of PlayerMan should wait until proper value of matches is given but I cannot make it work this way. When I type the values it sometimes catches them and decrease amount of matches but that's not exactly what I was up to :) Logics is : I check the value of current player. If it corresponds to this of the thread currently active I use scanner to catch the amount of matches. Else I wait one second (I know it's kinda harsh solution, but I have no other idea how to do it). Class Shared keeps the value of current player, and also amount of matches. By the way, is there any way I can make Player and Shared attributes private instead of public and still make the code work ? CONSOLE and INPUT-DIALOG is just for choosing way of inserting values. class PlayerMan extends Player{ static final int CONSOLE=0; static final int INPUT_DIALOG=1; private int input; public PlayerMan(String name, Shared data, int c){ super(name, data); input = c; } @Override public void run(){ Scanner scanner = new Scanner(System.in); int n = 0; System.out.println("Matches on table: "+data.matchesAmount); System.out.println("which: "+data.which); System.out.println("number: "+number); while(data.matchesAmount != 0){ if(number == data.which){ System.out.println("Choose amount of matches (from 1 to 3): "); n = scanner.nextInt(); if(data.matchesAmount == 1){ System.out.println("There's only 1 match left !"); while(n != 1){ n = scanner.nextInt(); } } else{ do{ n = scanner.nextInt(); } while(n <= 1 && n >= 3); } data.matchesAmount = data.matchesAmount - n; System.out.println(" "+ name+" takes "+n+" matches."); if(number != 0){ data.which = 0; } else{ data.which = 1; } } else{ try { Thread.sleep(1000); } catch(InterruptedException exc) { System.out.println("End of thread."); return; } } System.out.println("Matches on table: "+data.matchesAmount); } if(data.matchesAmount == 0){ System.out.println("Winner is player: "+name); stop(); } } }

    Read the article

  • startActivityForResult to an activity that only displays a progressdialog

    - by Alxandr
    I'm trying to make an activity that is asked for some result. This result is normally returned instantly (in the onCreate), however, sometimes it is nesesary to wait for some internet-content to download which causes the "loader"-activity to show. What I want is that the loader-activity don't display anything more than a progressdialog (and that you can still se the old activity calling the loader-activity in the background) and I'm wondering wheather or not this is possible. The code I'm using as of now is: //ListComicsActivity.java public class ListComicsActivity extends Activity { private static final int REQUEST_COMICS = 1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_comics); Button button = (Button)findViewById(R.id.Button01); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(Intents.ACTION_GET_COMICS); startActivityForResult(intent, REQUEST_COMICS); } }); } /** Called when an activity called by using startActivityForResult finishes. */ @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { Toast toast = Toast.makeText(this, "The activity finnished", Toast.LENGTH_SHORT); toast.show(); } } //LoaderActivity.java (answers to Intents.ACTION_GET_COMICS action-filter) public class LoaderActivity extends Activity { private Intent result = null; private ProgressDialog pg = null; private Runnable returner = new Runnable() { public void run() { if(pg != null) pg.dismiss(); LoaderActivity.this.setResult(Activity.RESULT_OK, result); LoaderActivity.this.finish(); } }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String action = getIntent().getAction(); if(action.equals(Intents.ACTION_GET_COMICS)) { Runnable loader = new Runnable() { public void run() { WebProvider.DownloadComicList(); Intent intent = new Intent(); intent.setDataAndType(ComicContentProvider.COMIC_URI, "vnd.android.cursor.dir/vnd.mymir.comic"); returnResult(intent); } }; pg = ProgressDialog.show(this, "Downloading", "Please wait, retrieving data...."); Thread thread = new Thread(null, loader, "LoadComicList"); thread.start(); } else { setResult(Activity.RESULT_CANCELED); finish(); } } private void returnResult(Intent intent) { result = intent; runOnUiThread(returner); } }

    Read the article

  • what does mean "SQL Error: 30000, SQLState: XSAI3" ?

    - by phmr
    I'm using javadb/derbydb 10.5.3.0 with hibernate 3.5-Final I get this error at the end of EM initialisation : 4427 [SwingWorker-pool-1-thread-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 30000, SQLState: XSAI3 4427 [SwingWorker-pool-1-thread-1] ERROR org.hibernate.util.JDBCExceptionReporter - Feature not implemented. SQL Error 30000 doesn't seem to be documented http://developers.sun.com/docs/javadb/10.3.3.0/ref/ref-single.html#rrefexcept71493

    Read the article

< Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >