Search Results

Search found 165 results on 7 pages for 'cmp'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Problem with asm program (nasm)

    - by GLeBaTi
    org 0x100 SEGMENT .CODE mov ah,0x9 mov dx, Msg1 int 0x21 ;string input mov ah,0xA mov dx,buff int 0x21 mov ax,0 mov al,[buff+1]; length ;string UPPERCASE mov cl, al mov si, buff cld loop1: lodsb; cmp al, 'a' jnb upper loop loop1 ;output mov ah,0x9 mov dx, buff int 0x21 exit: mov ah, 0x8 int 0x21 int 0x20 upper: sub al,32 jmp loop1 SEGMENT .DATA Msg1 db 'Press string: $' buff db 254,0 this code perform poorly. I think that problem in "jnb upper". This program make small symbols into big symbols.

    Read the article

  • easy asm program(nasm)

    - by GLeBaTi
    org 0x100 SEGMENT .CODE mov ah,0x9 mov dx, Msg1 int 0x21 ;string input mov ah,0xA mov dx,buff int 0x21 mov ax,0 mov al,[buff+1]; length ;string UPPERCASE mov cl, al mov si, buff cld loop1: lodsb; cmp al, 'a' jnb upper loop loop1 ;output mov ah,0x9 mov dx, buff int 0x21 exit: mov ah, 0x8 int 0x21 int 0x20 upper: sub al,32 jmp loop1 SEGMENT .DATA Msg1 db 'Press string: $' buff db 254,0 this code perform poorly. I think that problem in "jnb upper". This program make small symbols into big symbols.

    Read the article

  • How to config a default global EJB transaction attribute in JBoss Server?

    - by seven
    my project need to migrate from oc4j to jboss. But it seems that default EJB transaction attribute is different between them. For OC4J: If you do not specify any transaction attributes for an EJB method then OC4J uses default transaction attributes. OC4J by default uses Required for CMP 2.0, NotSupported for MDBs and Supports for all other types of EJBs. (refer to official doc) For JBoss: default for all types EJB is Required. (Maybe , refer to un-official site) To migrate my project within less effort, how to config a default global EJB transaction attribute, e.g. Supports, in JBoss Server?

    Read the article

  • YouTube app fails to open up when launched.

    - by user354738
    Below logs gives any clue ? The app just opens up (we could just see the tite of the app as YouTube and it goes back to launcher tray immd.) cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.youtube/.HomeActivity } 05-31 14:06:41.655: INFO/ActivityManager(1102): Start proc com.google.android.youtube for activity com.google.android.youtube/.HomeActivity: pid=2977 uid=10041 gids={3003} 05-31 14:06:41.655: DEBUG/KeyguardViewMediator(1102): setHidden false 05-31 14:06:41.796: INFO/foo(1102): ********************** resuming: 1144012408 05-31 14:06:41.897: INFO/ActivityThread(2977): Publishing provider com.google.android.youtube.SuggestionProvider: com.google.android.youtube.suggest.SuggestionProvider 05-31 14:06:41.960: INFO/YouTube(2977): Distribution channel:mvapp-android-google 05-31 14:06:42.116: INFO/AndroidRuntime(2977): AndroidRuntime onExit calling exit(-42) 05-31 14:06:42.116: INFO/dalvikvm(2977): In threadExitCheck 0xbdb0 05-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread exited without telling us 05-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread 2977 status: 7 05-31 14:06:42.124: DEBUG/KeyguardViewMediator(1102): setHidden false 05-31 14:06:42.139: INFO/ActivityManager(1102): Process com.google.android.youtube (pid 2977) has died

    Read the article

  • YouTube app failes to open up when launched.

    - by user354738
    Below logs gives any clue ? The app just opens up (we could just see the tite of the app as YouTube and it goes back to launcher tray immd.) cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.youtube/.HomeActivity } 05-31 14:06:41.655: INFO/ActivityManager(1102): Start proc com.google.android.youtube for activity com.google.android.youtube/.HomeActivity: pid=2977 uid=10041 gids={3003} 05-31 14:06:41.655: DEBUG/KeyguardViewMediator(1102): setHidden false 05-31 14:06:41.796: INFO/foo(1102): ********** resuming: 1144012408 05-31 14:06:41.897: INFO/ActivityThread(2977): Publishing provider com.google.android.youtube.SuggestionProvider: com.google.android.youtube.suggest.SuggestionProvider 05-31 14:06:41.960: INFO/YouTube(2977): Distribution channel:mvapp-android-google 05-31 14:06:42.116: INFO/AndroidRuntime(2977): AndroidRuntime onExit calling exit(-42) 05-31 14:06:42.116: INFO/dalvikvm(2977): In threadExitCheck 0xbdb0 05-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread exited without telling us 05-31 14:06:42.116: ERROR/dalvikvm(2977): Native thread 2977 status: 7 05-31 14:06:42.124: DEBUG/KeyguardViewMediator(1102): setHidden false 05-31 14:06:42.139: INFO/ActivityManager(1102): Process com.google.android.youtube (pid 2977) has died

    Read the article

  • Open another application from your own (intent)

    - by AndersWid
    I know how to update my own programs, and I know how to open programs using the a predefined Uri (for sms or email for example) I need to know how I can create an Intent to open MyTracks or any other application that I don't know what intents they listen to. I got this info from DDMS, but I havn't been succesful in turning this to an Intent I can use. This is taken from when opening MyTracks manually. Thanks for your help 05-06 11:22:24.945: INFO/ActivityManager(76): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks bnds=[243,338][317,417] } 05-06 11:22:25.005: INFO/ActivityManager(76): Start proc com.google.android.maps.mytracks for activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: pid=1176 uid=10063 gids={3003, 1015} 05-06 11:22:26.995: INFO/ActivityManager(76): Displayed activity com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks: 1996 ms (total 1996 ms)

    Read the article

  • XCode 3.2.5 Cocoa project modifies linked 3rd party dylib. Why?

    - by Barrie
    I'm linking a 3rd party dylib into a cocoa project. And I arrange for XCode to copy it into the Frameworks directory of the app. But when I cmp the original dylib with the dylib in Frameworks I discover the 3rd party dylib has been modified. I have some old XCode cocoa projects which don't do this, i.e. the dylib in Frameworks is the same as the original. I've tried modifying the XCode projects to isolate what is causing the dylib to be modified but so far no luck. Any ideas?

    Read the article

  • Pragmas and exceptions

    - by Darryl Gove
    The compiler pragmas: #pragma no_side_effect(routinename) #pragma does_not_write_global_data(routinename) #pragma does_not_read_global_data(routinename) are used to tell the compiler more about the routine being called, and enable it to do a better job of optimising around the routine. If a routine does not read global data, then global data does not need to be stored to memory before the call to the routine. If the routine does not write global data, then global data does not need to be reloaded after the call. The no side effect directive indicates that the routine does no I/O, does not read or write global data, and the result only depends on the input. However, these pragmas should not be used on routines that throw exceptions. The following example indicates the problem: #include <iostream extern "C" { int exceptional(int); #pragma no_side_effect(exceptional) } int exceptional(int a) { if (a==7) { throw 7; } else { return a+1; } } int a; int c=0; class myclass { public: int routine(); }; int myclass::routine() { for(a=0; a<1000; a++) { c=exceptional(c); } return 0; } int main() { myclass f; try { f.routine(); } catch(...) { std::cout << "Something happened" << a << c << std::endl; } } The routine "exceptional" is declared as having no side effects, however it can throw an exception. The no side effects directive enables the compiler to avoid storing global data back to memory, and retrieving it after the function call, so the loop containing the call to exceptional is quite tight: $ CC -O -S test.cpp ... .L77000061: /* 0x0014 38 */ call exceptional ! params = %o0 ! Result = %o0 /* 0x0018 36 */ add %i1,1,%i1 /* 0x001c */ cmp %i1,999 /* 0x0020 */ ble,pt %icc,.L77000061 /* 0x0024 */ nop However, when the program is run the result is incorrect: $ CC -O t.cpp $ ./a.out Something happend00 If the code had worked correctly, the output would have been "Something happened77" - the exception occurs on the seventh iteration. Yet, the current code produces a message that uses the original values for the variables 'a' and 'c'. The problem is that the exception handler reads global data, and due to the no side effects directive the compiler has not updated the global data before the function call. So these pragmas should not be used on routines that have the potential to throw exceptions.

    Read the article

  • How can I find a list of all SSE instructions? What happens if a CPU doesn't support SSE?

    - by Blastcore
    So I've been reading about how processors work. Now I'm on the instructions (SSE, SSE2, etc) stuff. (Which is pretty interesting). I have lot of questions (I've been reading this stuff on Wikipedia): I've saw the names of some instructions that were added on SSE, however there's no explanation about any of them (Maybe SSE4? They're not even listed on Wikipedia). Where can I read about what they do? How do I know which of these instructions are being used? If we do know which are being used, let's say I'm doing a comparison, (This may be the most stupid question I've ever asked, I don't know about assembly, though) Is it possible to directly use the instruction on an assembly code? (I've been looking at this: http://asm.inightmare.org/opcodelst/index.php?op=CMP) How does the processor interpret the instructions? What would happen if I had a processor without any of the SSE instructions? (I suppose in the case we want to do a comparison, we wouldn't be able to, right?)

    Read the article

  • Edit Contact code worked in 1.6 but doesn't work on Droid 2.1?

    - by user225405
    Hi All, I had some fairly simple code in my app to invoke Edit Contact activity on a known good contact index that worked in Android 1.6 but is broken for me now in Android 2.1 on the Droid. I built a sample activity/app 'EdCon' to show this: package com.jbh; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; public class EdCon extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Build an intent to edit a known good contact index Intent i; i = new Intent(Intent.ACTION_EDIT); i.setData(Uri.parse("content://contacts/people/10")); startActivity(i); } } When I run this on my G1 running 1.6 it works as expected i.e. brings up the Edit Contact screen for the known index and then I can hit BACK to return to "Hello World, EdCon". When I run this on the Droid under 2.1 I get the following: 05-07 15:35:57.787: INFO/ActivityManager(1013): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.jbh/.EdCon } 05-07 15:35:57.826: DEBUG/AndroidRuntime(13780): Shutting down VM 05-07 15:35:57.826: DEBUG/dalvikvm(13780): DestroyJavaVM waiting for non-daemon threads to exit 05-07 15:35:57.928: DEBUG/dalvikvm(13780): DestroyJavaVM shutting VM down 05-07 15:35:57.928: DEBUG/dalvikvm(13780): HeapWorker thread shutting down 05-07 15:35:57.928: DEBUG/dalvikvm(13780): HeapWorker thread has shut down 05-07 15:35:57.928: DEBUG/jdwp(13780): JDWP shutting down net... 05-07 15:35:57.928: DEBUG/jdwp(13780): Got wake-up signal, bailing out of select 05-07 15:35:57.928: INFO/dalvikvm(13780): Debugger has detached; object registry had 1 entries 05-07 15:35:57.928: DEBUG/dalvikvm(13780): VM cleaning up 05-07 15:35:57.935: INFO/ActivityManager(1013): Start proc com.jbh for activity com.jbh/.EdCon: pid=13802 uid=10052 gids={1015} 05-07 15:35:57.967: ERROR/AndroidRuntime(13780): ERROR: thread attach failed 05-07 15:35:58.053: INFO/ActivityThread(13792): Publishing provider com.android.vending.SuggestionsProvider: com.android.vending.SuggestionsProvider 05-07 15:35:58.154: INFO/dalvikvm(13802): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38) 05-07 15:35:58.209: DEBUG/dalvikvm(13780): LinearAlloc 0x0 used 639500 of 5242880 (12%) 05-07 15:35:58.365: INFO/dalvikvm(13802): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=18) 05-07 15:35:58.639: INFO/ActivityManager(1013): Starting activity: Intent { act=android.intent.action.EDIT dat=content://contacts/people/10 cmp=com.android.contacts/.ui.EditContactActivity } 05-07 15:35:58.975: DEBUG/dalvikvm(13137): GC freed 2902 objects / 166768 bytes in 61ms 05-07 15:35:59.100: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.run(): Syncing local DB with package manager... 05-07 15:35:59.100: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.syncLocalDbWithPackageManager(): No INSTALLING or UNINSTALLING assets. 05-07 15:35:59.115: INFO/ActivityManager(1013): Displayed activity com.android.contacts/.ui.EditContactActivity: 387 ms (total 1296 ms) 05-07 15:35:59.185: DEBUG/Sources(13137): Creating external source for type=com.facebook.auth.login, packageName=com.facebook.katana 05-07 15:35:59.225: DEBUG/vending(13792): com.android.vending.LocalDbSyncService.run(): Syncing done. 05-07 15:35:59.232: WARN/dalvikvm(13137): threadid=27: thread exiting with uncaught exception (group=0x4001b180) 05-07 15:35:59.232: ERROR/AndroidRuntime(13137): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): java.lang.RuntimeException: An error occured while executing doInBackground() 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.os.AsyncTask$3.done(AsyncTask.java:200) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.FutureTask.setException(FutureTask.java:124) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.lang.Thread.run(Thread.java:1096) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): Caused by: android.database.sqlite.SQLiteException: no such column: raw_contact_id: , while compiling: SELECT account_name, account_type, sourceid, version, dirty, data_id, res_package, mimetype, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data_sync1, data_sync2, data_sync3, data_sync4, _id, is_primary, is_super_primary, data_version, group_sourceid, sync1, sync2, sync3, sync4, deleted, contact_id, starred, is_restricted FROM contact_entities_view WHERE (1) AND (raw_contact_id=10) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteProgram.native_compile(Native Method) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:59) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:49) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1221) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:316) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:3850) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:3840) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.providers.contacts.ContactsProvider2$RawContactsEntityIterator.(ContactsProvider2.java:4498) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.providers.contacts.ContactsProvider2.queryEntities(ContactsProvider2.java:4751) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.content.ContentProvider$Transport.queryEntities(ContentProvider.java:140) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.content.ContentProviderClient.queryEntities(ContentProviderClient.java:98) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.content.ContentResolver.queryEntities(ContentResolver.java:296) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.contacts.model.EntitySet.fromQuery(EntitySet.java:72) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.doInBackground(EditContactActivity.java:191) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.doInBackground(EditContactActivity.java:154) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at com.android.contacts.util.WeakAsyncTask.doInBackground(WeakAsyncTask.java:45) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at android.os.AsyncTask$2.call(AsyncTask.java:185) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 05-07 15:35:59.295: ERROR/AndroidRuntime(13137): ... 4 more 05-07 15:35:59.303: INFO/Process(1013): Sending signal. PID: 13137 SIG: 3 05-07 15:35:59.303: INFO/dalvikvm(13137): threadid=7: reacting to signal 3 05-07 15:35:59.303: ERROR/dalvikvm(13137): Unable to open stack trace file '/data/anr/traces.txt': Permission denied 05-07 15:35:59.506: INFO/DumpStateReceiver(1013): Added state dump to 1 crashes 05-07 15:36:07.053: DEBUG/dalvikvm(12901): GC freed 389 objects / 25056 bytes in 145ms 05-07 15:36:17.287: DEBUG/dalvikvm(11649): GC freed 154 objects / 6816 bytes in 136ms 05-07 15:36:22.365: DEBUG/dalvikvm(13574): GC freed 348 objects / 67848 bytes in 112ms 05-07 15:36:27.451: DEBUG/dalvikvm(11836): GC freed 267 objects / 17432 bytes in 65ms 05-07 15:36:32.553: DEBUG/dalvikvm(12757): GC freed 1888 objects / 92440 bytes in 67ms 05-07 15:36:38.803: INFO/power(1013): * set_screen_state 0 05-07 15:36:38.813: DEBUG/SurfaceFlinger(1013): About to give-up screen, flinger = 0x114c30 05-07 15:36:38.826: DEBUG/Sensors(1013): using accelerometer (name=accelerometer) 05-07 15:36:38.834: DEBUG/PhoneWindow(13137): couldn't save which view has focus because the focused view android.widget.ScrollView@44883558 has no id. 05-07 15:36:38.865: DEBUG/WifiService(1013): ACTION_SCREEN_OFF 05-07 15:36:38.889: DEBUG/WifiService(1013): setting ACTION_DEVICE_IDLE timer for 900000ms 05-07 15:36:44.107: DEBUG/dalvikvm(1013): GC freed 7351 objects / 521440 bytes in 130ms 05-07 15:36:49.373: DEBUG/dalvikvm(13553): GC freed 321 objects / 12056 bytes in 102ms The no such column: raw_contact_id: looks like the issue but I'm not sure how or why that would happen or what it means. Any help appreciated! [email protected]

    Read the article

  • How to inhibit suspend temporarily?

    - by Zorn
    I have searched around a bit for this and can't seem to find anything helpful. I have my PC running Ubuntu 12.10 set up to suspend after 30 minutes of inactivity. I don't want to change that, it works great most of the time. What I do want to do is disable the automatic suspend if a particular application is running. How can I do this? The closest thing I've found so far is to add a shell script in /usr/lib/pm-utils/sleep.d which checks if the application is running and returns 1 to indicate that suspend should be prevented. But it looks like the system then gives up on suspending automatically, instead of trying again after another 30 minutes. (As far as I can tell, if I move the mouse, that restarts the timer again.) It's quite likely the application will finish after a couple of hours, and I'd rather my PC then suspended automatically if I'm not using it at that point. (So I don't want to add a call to pm-suspend when the application finishes.) Is this possible? Any advice would be appreciated. Cheers. EDIT: As I noted in one of the comments below, what I actually wanted was to inhibit suspend when my PC was serving files over NFS; I just wanted to focus on the "suspend" part of the question because I already had an idea how to solve the NFS part. Using the 'xdotool' idea given in one of the answers, I have come up with the following script which I run from cron every few minutes. It's not ideal because it stops the screensaver kicking in as well, but it does work. I need to have a look at why 'caffeine' doesn't correctly re-enable suspend later on, then I could probably do better. Anyway, this does seem to work, so I'm including it here in case anyone else is interested. #!/bin/bash # If the output of this function changes between two successive runs of this # script, we inhibit auto-suspend. function check_activity() { /usr/sbin/nfsstat --server --list } # Prevent the automatic suspend from kicking in. function inhibit_suspend() { # Slightly jiggle the mouse pointer about; we do a small step and # reverse step to try to stop this being annoying to anyone using the # PC. TODO: This isn't ideal, apart from being a bit hacky it stops # the screensaver kicking in as well, when all we want is to stop # the PC suspending. Can 'caffeine' help? export DISPLAY=:0.0 xdotool mousemove_relative --sync -- 1 1 xdotool mousemove_relative --sync -- -1 -1 } LOG="$HOME/log/nfs-suspend-blocker.log" ACTIVITYFILE1="$HOME/tmp/nfs-suspend-blocker.current" ACTIVITYFILE2="$HOME/tmp/nfs-suspend-blocker.previous" echo "Started run at $(date)" >> "$LOG" if [ ! -f "$ACTIVITYFILE1" ]; then check_activity > "$ACTIVITYFILE1" exit 0; fi /bin/mv "$ACTIVITYFILE1" "$ACTIVITYFILE2" check_activity > "$ACTIVITYFILE1" if cmp --quiet "$ACTIVITYFILE1" "$ACTIVITYFILE2"; then echo "No activity detected since last run" >> "$LOG" else echo "Activity detected since last run; inhibiting suspend" >> "$LOG" inhibit_suspend fi

    Read the article

  • What is Causing This Memory Leak in Delphi?

    - by lkessler
    I just can't figure out this memory leak that EurekaLog is reporting for my program. I'm using Delphi 2009. Here it is: Memory Leak: Type=Data; Total size=26; Count=1; The stack is: System.pas _UStrSetLength 17477 System.pas _UStrCat 17572 Process.pas InputGedcomFile 1145 That is all there is in the stack. EurekaLog is pointing me to the location where the memory that was not released was first allocated. According to it, the line in my program is line 1145 of InputGedcomFile. That line is: CurStruct0Key := 'HEAD' + Level0Key; where CurStruct0Key and Level0Key are simply defined in the procedure as local variables that should be dynamically handled by the Delphi memory manager when entering and leaving the procedure: var CurStruct0Key, Level0Key: string; So now I look at the _UStrCat procedure in the System Unit. Line 17572 is: CALL _UStrSetLength // Set length of Dest and I go to the _UStrSetLength procedure in the System Unit, and the relevant lines are: @@isUnicode: CMP [EAX-skew].StrRec.refCnt,1 // !!! MT safety JNE @@copyString // not unique, so copy SUB EAX,rOff // Offset EAX "S" to start of memory block ADD EDX,EDX // Double length to get size JO @@overflow ADD EDX,rOff+2 // Add string rec size JO @@overflow PUSH EAX // Put S on stack MOV EAX,ESP // to pass by reference CALL _ReallocMem POP EAX ADD EAX,rOff // Readjust MOV [EBX],EAX // Store MOV [EAX-skew].StrRec.length,ESI MOV WORD PTR [EAX+ESI*2],0 // Null terminate TEST EDI,EDI // Was a temp created? JZ @@exit PUSH EDI MOV EAX,ESP CALL _LStrClr POP EDI JMP @@exit where line 17477 is the "CALL _ReallocMem" line. So then what is the memory leak? Surely a simple concatenate of a string constant to a local string variable should not be causing a memory leak. Why is EurekaLog pointing me to the ReallocMem line in a _UStrSetLength routine that is part of Delphi? This is Delphi 2009 and I am using the new unicode strings. Any help or explanation here will be much appreciated.

    Read the article

  • Sqlite Database LEAK FOUND exception in android?

    - by androidbase
    hi all, i am getting this exception in database Leak Found my LOGCAT Shows this: 02-17 17:20:37.857: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Bru_Bears_Womens_View (has extras) } 02-17 17:20:38.477: DEBUG/dalvikvm(434): GC freed 1086 objects / 63888 bytes in 119ms 02-17 17:20:38.556: ERROR/Database(434): Leak found 02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/com.example.brown/databases/BRUNEWS_DB_01.db SQLiteDatabase created and never closed 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1694) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473) 02-17 17:20:38.556: ERROR/Database(434): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98) 02-17 17:20:38.556: ERROR/Database(434): at com.example.brown.Brown_Splash.onCreate(Brown_Splash.java:52) 02-17 17:20:38.556: ERROR/Database(434): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Handler.dispatchMessage(Handler.java:99) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Looper.loop(Looper.java:123) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invokeNative(Native Method) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invoke(Method.java:521) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-17 17:20:38.556: ERROR/Database(434): at dalvik.system.NativeStart.main(Native Method) how can i solve it??? thanks in advance...

    Read the article

  • Android: HTTPClient

    - by primal
    Hi, I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console. [2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET I have added android.permission.INTERNET in AndroidManifest.xml. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.org.example" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HalloAndroid" android:label="@string/app_name" android:permission="android.permission.INTERNET"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest> The java code in HalloAndroid.java is as follows HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget2 = new HttpGet("http://google.com/"); HttpResponse response2 = null; try { response2 = httpclient.execute(httpget2); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response2.getEntity(); if (entity != null) { long len = entity.getContentLength(); if (len != -1 && len < 2048) { try { Log.d(TAG, EntityUtils.toString(entity)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // Stream content out } Any help is much appreciated.

    Read the article

  • phonegap.js crashes android app

    - by peirix
    I'm having this weird problem, where including the phonegap.js file in my project causes the app to crash on both the android emulator and my phone. I got the latest file from GitHub, so I can't see why this isn't working. This happens even if I try to build the sample project that's included in the PhoneGap download... Console log: [2010-12-17 11:05:14 - sample] Android Launch! [2010-12-17 11:05:14 - sample] adb is running normally. [2010-12-17 11:05:14 - sample] Performing com.phonegap.sample.sample activity launch [2010-12-17 11:05:14 - sample] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'FirstDevice' [2010-12-17 11:05:16 - sample] Uploading sample.apk onto device 'emulator-5554' [2010-12-17 11:05:16 - sample] Installing sample.apk... [2010-12-17 11:05:21 - sample] Success! [2010-12-17 11:05:22 - sample] Starting activity com.phonegap.sample.sample on device emulator-5554 [2010-12-17 11:05:23 - sample] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.phonegap.sample/.sample } LogCat: 12-17 11:13:12.533: DEBUG/AndroidRuntime(373): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< 12-17 11:13:12.533: DEBUG/AndroidRuntime(373): CheckJNI is ON 12-17 11:13:13.453: DEBUG/AndroidRuntime(373): Calling main entry com.android.commands.pm.Pm 12-17 11:13:13.503: DEBUG/AndroidRuntime(373): Shutting down VM 12-17 11:13:13.513: DEBUG/dalvikvm(373): GC_CONCURRENT freed 101K, 71% free 297K/1024K, external 0K/0K, paused 2ms+2ms 12-17 11:13:13.523: INFO/AndroidRuntime(373): NOTE: attach of thread 'Binder Thread #3' failed 12-17 11:13:13.523: DEBUG/dalvikvm(373): Debugger has detached; object registry had 1 entries 12-17 11:13:14.113: DEBUG/AndroidRuntime(383): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<< 12-17 11:13:14.113: DEBUG/AndroidRuntime(383): CheckJNI is ON 12-17 11:13:14.853: DEBUG/AndroidRuntime(383): Calling main entry com.android.commands.am.Am 12-17 11:13:14.894: INFO/ActivityManager(62): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.phonegap.sample/.sample } from pid 383 12-17 11:13:14.973: INFO/ActivityManager(62): Start proc com.phonegap.sample for activity com.phonegap.sample/.sample: pid=391 uid=10031 gids={1006, 3003, 1015} 12-17 11:13:14.983: DEBUG/AndroidRuntime(383): Shutting down VM 12-17 11:13:15.053: DEBUG/dalvikvm(383): GC_CONCURRENT freed 102K, 69% free 319K/1024K, external 0K/0K, paused 2ms+2ms 12-17 11:13:15.093: INFO/AndroidRuntime(383): NOTE: attach of thread 'Binder Thread #3' failed 12-17 11:13:15.143: DEBUG/dalvikvm(383): Debugger has detached; object registry had 1 entries 12-17 11:13:15.523: DEBUG/dalvikvm(33): GC_EXPLICIT freed 11K, 54% free 2520K/5379K, external 716K/1038K, paused 467ms 12-17 11:13:15.663: DEBUG/dalvikvm(33): GC_EXPLICIT freed <1K, 54% free 2520K/5379K, external 716K/1038K, paused 132ms 12-17 11:13:15.772: DEBUG/dalvikvm(33): GC_EXPLICIT freed <1K, 54% free 2520K/5379K, external 716K/1038K, paused 113ms 12-17 11:13:16.333: INFO/ARMAssembler(62): generated scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at [0x43aff6f0:0x43aff8a8] in 686000 ns 12-17 11:13:17.493: INFO/ActivityManager(62): Displayed com.phonegap.sample/.sample: +2s540ms 12-17 11:13:18.163: DEBUG/szipinf(391): Initializing inflate state 12-17 11:13:18.173: DEBUG/szipinf(391): Initializing zlib to inflate 12-17 11:13:18.573: WARN/dalvikvm(391): JNI WARNING: jarray 0x40567330 points to non-array object (Ljava/lang/String;) 12-17 11:13:18.593: INFO/dalvikvm(391): "WebViewCoreThread" prio=5 tid=9 NATIVE 12-17 11:13:18.603: INFO/dalvikvm(391): | group="main" sCount=0 dsCount=0 obj=0x4051b880 self=0x1af760 12-17 11:13:18.603: INFO/dalvikvm(391): | sysTid=400 nice=0 sched=0/0 cgrp=default handle=1778000 12-17 11:13:18.623: INFO/dalvikvm(391): | schedstat=( 851184092 892639082 140 ) 12-17 11:13:18.633: INFO/dalvikvm(391): at android.webkit.LoadListener.nativeFinished(Native Method) 12-17 11:13:18.633: INFO/dalvikvm(391): at android.webkit.LoadListener.nativeFinished(Native Method) 12-17 11:13:18.653: INFO/dalvikvm(391): at android.webkit.LoadListener.tearDown(LoadListener.java:1200) 12-17 11:13:18.653: INFO/dalvikvm(391): at android.webkit.LoadListener.handleEndData(LoadListener.java:721) 12-17 11:13:18.653: INFO/dalvikvm(391): at android.webkit.LoadListener.handleMessage(LoadListener.java:219) 12-17 11:13:18.672: INFO/dalvikvm(391): at android.os.Handler.dispatchMessage(Handler.java:99) 12-17 11:13:18.672: INFO/dalvikvm(391): at android.os.Looper.loop(Looper.java:123) 12-17 11:13:18.672: INFO/dalvikvm(391): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629) 12-17 11:13:18.672: INFO/dalvikvm(391): at java.lang.Thread.run(Thread.java:1019) 12-17 11:13:18.672: ERROR/dalvikvm(391): VM aborting 12-17 11:13:18.887: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 12-17 11:13:18.887: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys' 12-17 11:13:18.893: INFO/DEBUG(31): pid: 391, tid: 400 >>> com.phonegap.sample <<< 12-17 11:13:18.893: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d 12-17 11:13:18.893: INFO/DEBUG(31): r0 fffffebc r1 deadd00d r2 00000026 r3 00000000 12-17 11:13:18.893: INFO/DEBUG(31): r4 81da45c8 r5 40567330 r6 81d8592c r7 001b2a48 12-17 11:13:18.893: INFO/DEBUG(31): r8 43640b58 r9 42dd1ecc 10 42dd1eb4 fp 4168d82c 12-17 11:13:18.893: INFO/DEBUG(31): ip 81da4728 sp 43640410 lr afd19375 pc 81d45a02 cpsr 20000030 12-17 11:13:19.183: INFO/DEBUG(31): #00 pc 00045a02 /system/lib/libdvm.so 12-17 11:13:19.183: INFO/DEBUG(31): #01 pc 000376fc /system/lib/libdvm.so 12-17 11:13:19.183: INFO/DEBUG(31): #02 pc 000399c4 /system/lib/libdvm.so 12-17 11:13:19.193: INFO/DEBUG(31): #03 pc 0003a4a0 /system/lib/libdvm.so 12-17 11:13:19.203: INFO/DEBUG(31): #04 pc 0032b6d6 /system/lib/libwebcore.so 12-17 11:13:19.203: INFO/DEBUG(31): #05 pc 002a4da4 /system/lib/libwebcore.so 12-17 11:13:19.203: INFO/DEBUG(31): #06 pc 001a6136 /system/lib/libwebcore.so 12-17 11:13:19.213: INFO/DEBUG(31): #07 pc 002a5870 /system/lib/libwebcore.so 12-17 11:13:19.223: INFO/DEBUG(31): #08 pc 00359e36 /system/lib/libwebcore.so 12-17 11:13:19.223: INFO/DEBUG(31): #09 pc 0035d30e /system/lib/libwebcore.so 12-17 11:13:19.223: INFO/DEBUG(31): #10 pc 003638be /system/lib/libwebcore.so 12-17 11:13:19.233: INFO/DEBUG(31): #11 pc 0019f6fa /system/lib/libwebcore.so 12-17 11:13:19.233: INFO/DEBUG(31): #12 pc 0019f780 /system/lib/libwebcore.so 12-17 11:13:19.243: INFO/DEBUG(31): #13 pc 001a3d8a /system/lib/libwebcore.so 12-17 11:13:19.243: INFO/DEBUG(31): #14 pc 000d0dca /system/lib/libwebcore.so 12-17 11:13:19.253: INFO/DEBUG(31): #15 pc 000d0f28 /system/lib/libwebcore.so 12-17 11:13:19.253: INFO/DEBUG(31): #16 pc 000d106e /system/lib/libwebcore.so 12-17 11:13:19.253: INFO/DEBUG(31): #17 pc 000ddef0 /system/lib/libwebcore.so 12-17 11:13:19.263: INFO/DEBUG(31): #18 pc 000ddf62 /system/lib/libwebcore.so 12-17 11:13:19.263: INFO/DEBUG(31): #19 pc 000f3ce2 /system/lib/libwebcore.so 12-17 11:13:19.273: INFO/DEBUG(31): #20 pc 002739ae /system/lib/libwebcore.so 12-17 11:13:19.273: INFO/DEBUG(31): #21 pc 000eac5e /system/lib/libwebcore.so 12-17 11:13:19.273: INFO/DEBUG(31): #22 pc 001b152c /system/lib/libwebcore.so 12-17 11:13:19.283: INFO/DEBUG(31): #23 pc 00017d34 /system/lib/libdvm.so 12-17 11:13:19.283: INFO/DEBUG(31): #24 pc 00048ec0 /system/lib/libdvm.so 12-17 11:13:19.283: INFO/DEBUG(31): #25 pc 00041a6a /system/lib/libdvm.so 12-17 11:13:19.293: INFO/DEBUG(31): #26 pc 0001cf94 /system/lib/libdvm.so 12-17 11:13:19.303: INFO/DEBUG(31): #27 pc 0002209c /system/lib/libdvm.so 12-17 11:13:19.303: INFO/DEBUG(31): #28 pc 00020f90 /system/lib/libdvm.so 12-17 11:13:19.313: INFO/DEBUG(31): #29 pc 0005f328 /system/lib/libdvm.so 12-17 11:13:19.313: INFO/DEBUG(31): #30 pc 0005f54e /system/lib/libdvm.so 12-17 11:13:19.313: INFO/DEBUG(31): #31 pc 00053b06 /system/lib/libdvm.so 12-17 11:13:19.313: INFO/DEBUG(31): code around pc: 12-17 11:13:19.313: INFO/DEBUG(31): 81d459e0 447a4479 ed0cf7d1 20004c09 ee34f7d1 12-17 11:13:19.323: INFO/DEBUG(31): 81d459f0 447c4808 6bdb5823 d0002b00 49064798 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a00 700a2226 eea0f7d1 0004355f 0004511d 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a10 0005ebd2 fffffebc deadd00d b510b40e 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a20 4c0a4b09 447bb083 aa05591b 6b5bca02 12-17 11:13:19.323: INFO/DEBUG(31): code around lr: 12-17 11:13:19.333: INFO/DEBUG(31): afd19354 b0834a0d 589c447b 26009001 686768a5 12-17 11:13:19.333: INFO/DEBUG(31): afd19364 220ce008 2b005eab 1c28d003 47889901 12-17 11:13:19.333: INFO/DEBUG(31): afd19374 35544306 d5f43f01 2c006824 b003d1ee 12-17 11:13:19.333: INFO/DEBUG(31): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0 12-17 11:13:19.333: INFO/DEBUG(31): afd19394 43551c3d a904b087 1c16ac01 604d9004 12-17 11:13:19.333: INFO/DEBUG(31): stack: 12-17 11:13:19.333: INFO/DEBUG(31): 436403d0 00000015 12-17 11:13:19.333: INFO/DEBUG(31): 436403d4 afd18407 /system/lib/libc.so 12-17 11:13:19.333: INFO/DEBUG(31): 436403d8 afd4270c /system/lib/libc.so 12-17 11:13:19.343: INFO/DEBUG(31): 436403dc afd426b8 /system/lib/libc.so 12-17 11:13:19.343: INFO/DEBUG(31): 436403e0 00000000 12-17 11:13:19.343: INFO/DEBUG(31): 436403e4 afd19375 /system/lib/libc.so 12-17 11:13:19.353: INFO/DEBUG(31): 436403e8 001af760 [heap] 12-17 11:13:19.353: INFO/DEBUG(31): 436403ec afd183d9 /system/lib/libc.so 12-17 11:13:19.353: INFO/DEBUG(31): 436403f0 001b2a48 [heap] 12-17 11:13:19.353: INFO/DEBUG(31): 436403f4 0005ebd2 [heap] 12-17 11:13:19.353: INFO/DEBUG(31): 436403f8 40567330 /dev/ashmem/dalvik-heap (deleted) 12-17 11:13:19.363: INFO/DEBUG(31): 436403fc 81d8592c /system/lib/libdvm.so 12-17 11:13:19.363: INFO/DEBUG(31): 43640400 001b2a48 [heap] 12-17 11:13:19.363: INFO/DEBUG(31): 43640404 afd18437 /system/lib/libc.so 12-17 11:13:19.363: INFO/DEBUG(31): 43640408 df002777 12-17 11:13:19.363: INFO/DEBUG(31): 4364040c e3a070ad 12-17 11:13:19.363: INFO/DEBUG(31): #00 43640410 00000001 12-17 11:13:19.363: INFO/DEBUG(31): 43640414 81d37701 /system/lib/libdvm.so 12-17 11:13:19.363: INFO/DEBUG(31): #01 43640418 00000001 12-17 11:13:19.363: INFO/DEBUG(31): 4364041c 81d399c9 /system/lib/libdvm.so 12-17 11:13:22.753: INFO/BootReceiver(62): Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE) 12-17 11:13:22.943: DEBUG/dalvikvm(62): GC_CONCURRENT freed 876K, 48% free 4240K/8135K, external 2269K/3469K, paused 9ms+10ms 12-17 11:13:23.133: DEBUG/dalvikvm(62): GC_FOR_MALLOC freed 348K, 47% free 4318K/8135K, external 2269K/3469K, paused 147ms 12-17 11:13:23.243: DEBUG/Zygote(33): Process 391 terminated by signal (11) 12-17 11:13:23.253: ERROR/InputDispatcher(62): channel '406defc8 com.phonegap.sample/com.phonegap.sample.sample (server)' ~ Consumer closed input channel or an error occurred. events=0x8 12-17 11:13:23.253: ERROR/InputDispatcher(62): channel '406defc8 com.phonegap.sample/com.phonegap.sample.sample (server)' ~ Channel is unrecoverably broken and will be disposed! 12-17 11:13:23.323: DEBUG/dalvikvm(62): GC_FOR_MALLOC freed 134K, 47% free 4376K/8135K, external 2269K/3469K, paused 174ms 12-17 11:13:23.323: INFO/ActivityManager(62): Process com.phonegap.sample (pid 391) has died. 12-17 11:13:23.333: INFO/WindowManager(62): WIN DEATH: Window{406defc8 com.phonegap.sample/com.phonegap.sample.sample paused=false} 12-17 11:13:23.542: DEBUG/dalvikvm(124): GC_EXPLICIT freed 61K, 51% free 2836K/5767K, external 1973K/2288K, paused 907ms 12-17 11:13:23.693: WARN/InputManagerService(62): Got RemoteException sending setActive(false) notification to pid 391 uid 10031 Sorry about the gigantic log posts, but I don't know what is of importance here...

    Read the article

  • How to use javascript-xpath

    - by Nirmal Patel
    I am using Selenium RC with IE 6 and XPath locators are terribly slow. So I am trying to see if javascript-xpath actually speeds up things. But could not find enough/clear documentation on how to use native x- path libraries. I am doing the following: protected void startSelenium (String testServer, String appName, String testInBrowser){ selenium = new DefaultSelenium("localhost", 4444, "*" +testInBrowser, testServer+ "/"+ appName + "/"); echo("selenium instance created:"+selenium.getClass()); selenium.start(); echo("selenium instance started..." + testServer + "/" + appName +"/"); selenium.runScript("lib/javascript-xpath-latest-cmp.js"); selenium.useXpathLibrary("javascript-xpath"); selenium.allowNativeXpath("true"); } This results in speed improvement of XPath locator but the improvements are not consistent. On some runs the time taken for a locator is halved; while sometimes its randomly high. Am I missing any configuration step here? Would be great if someone who has had success with this could share their views and approach. Thanks, Nirmal

    Read the article

  • Android HTTPClient not working inspite of giving permissions in manifest file.

    - by primal
    Hi, I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console. [2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET I have added android.permission.INTERNET in AndroidManifest.xml. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.org.example" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HalloAndroid" android:label="@string/app_name" android:permission="android.permission.INTERNET"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest> The java code in HalloAndroid.java is as follows HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget2 = new HttpGet("http://google.com/"); HttpResponse response2 = null; try { response2 = httpclient.execute(httpget2); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response2.getEntity(); if (entity != null) { long len = entity.getContentLength(); if (len != -1 && len < 2048) { try { Log.d(TAG, EntityUtils.toString(entity)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // Stream content out } Any help is much appreciated.

    Read the article

  • BroadcastReceiver not receiving an alarm's broadcast

    - by juanjux
    I have a code that sets a new repeating alarm (on production I'll use a inexactRepeating), but the BroadCastReceiver I've registered for handling it is not being called. Here is the code where I set the alarm: newAlarmPeriod = 5000; // For debugging Intent alarmIntent = new Intent(this, GroupsCheckAlarmReceiver.class); PendingIntent sender = PendingIntent.getBroadcast(this, Constants.CHECK_ALARM_CODE, alarmIntent, 0); AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + newAlarmPeriod, newAlarmPeriod, sender); It seems to work and it triggers and alarm every five seconds, as seen in the output of "adb shell dumpsys alarm": DUMP OF SERVICE alarm: Current Alarm Manager state: Realtime wakeup (now=1269941046923): RTC_WAKEUP #1: Alarm{43cbac58 type 0 android} type=0 when=1269997200000 repeatInterval=0 count=0 operation=PendingIntent{43bb1738: PendingIntentRecord{43bb1248 android broadcastIntent}} RTC_WAKEUP #0: Alarm{43ce30e0 type 0 com.almarsoft.GroundhogReader} type=0 when=1269941049555 repeatInterval=5000 count=1 operation=PendingIntent{43d990c8: PendingIntentRecord{43d49108 com.almarsoft.GroundhogReader broadcastIntent}} RTC #1: Alarm{43bfc250 type 1 android} type=1 when=1269993600000 repeatInterval=0 count=0 operation=PendingIntent{43c5a618: PendingIntentRecord{43c4f048 android broadcastIntent}} RTC #0: Alarm{43d67dd8 type 1 android} type=1 when=1269941100000 repeatInterval=0 count=0 operation=PendingIntent{43c4e0f0: PendingIntentRecord{43c4f6c8 android broadcastIntent}} Broadcast ref count: 0 Alarm Stats: android 24390ms running, 0 wakeups 80 alarms: act=android.intent.action.TIME_TICK flg=0x40000004 com.almarsoft.GroundhogReader 26ms running, 2 wakeups 2 alarms: flg=0x4 cmp=com.almarsoft.GroundhogReader/.GroupsCheckAlarmReceiver But for some reason my BroadCastReceiver is not being called when the alarm is triggered. I've declared it on the Manifest: <receiver android:name=".GroupsCheckAlarmReceiver" /> And this is the abbreviated code: public class GroupsCheckAlarmReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "XXX Alarm worked.", Toast.LENGTH_LONG).show(); Log.d("XXX", "GroupsCheckAlarmReceiver.onReceive"); }

    Read the article

  • Problem calling std::max

    - by Eric
    I compiled my bison-generated files in Visual Studio and got these errors: ...\position.hh(83): error C2589: '(' : illegal token on right side of '::' ...\position.hh(83): error C2059: syntax error : '::' ...\position.hh(83): error C2589: '(' : illegal token on right side of '::' ...\position.hh(83): error C2059: syntax error : '::' The corresponding code is: inline void columns (int count = 1) { column = std::max (1u, column + count); } I think the problem is with std::max; if I change std::max to equivalent code then there is no problem anymore, but is there a better solution instead of changing the generated code? Here is the bison file I wrote: // // bison.yy // %skeleton "lalr1.cc" %require "2.4.2" %defines %define parser_class_name "cmd_parser" %locations %debug %error-verbose %code requires { class ParserDriver; } %parse-param { ParserDriver& driver } %lex-param { ParserDriver& driver } %union { struct ast *a; double d; struct symbol *s; struct symlist *sl; int fn; } %code { #include "helper_func.h" #include "ParserDriver.h" std::string error_msg = ""; } %token <d> NUMBER %token <s> NAME %token <fn> FUNC %token EOL %token IF THEN ELSE WHILE DO LET %token SYM_TABLE_OVERFLOW %token UNKNOWN_CHARACTER %nonassoc <fn> CMP %right '=' %left '+' '-' %left '*' '/' %nonassoc '|' UMINUS %type <a> exp stmt list explist %type <sl> symlist %{ extern int yylex(yy::cmd_parser::semantic_type *yylval, yy::cmd_parser::location_type* yylloc); %} %start calclist %% ... grammar rules ...

    Read the article

  • Pressing back button in ActivityGroup causes it to pause, and then continue shutting down the next t

    - by synic
    Pressing the back button causes onPause to be called, and the app stays paused until it is re-launched by clicking on the icon, at which point, onDestroy gets called, and the main activity continues to shut down. Simple class to demonstrate. Note, as far as I can tell, this only happens on the Nexus One. I can't reproduce it in the emulator or on my Droid. package com.vimtips.testshutdown; import android.app.ActivityGroup; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; public class MainActivity extends ActivityGroup { private static final String TAG = "MainActivity"; private int counter = 3; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK) { if(counter-- > 0) return true; } return super.onKeyDown(keyCode, event); } @Override public void onPause() { super.onPause(); Log.d(TAG, "onPause called"); } @Override public void onDestroy() { super.onDestroy(); if(isFinishing()) { Log.d(TAG, "Shutting down"); } } } And here's the log: I/ActivityManager( 132): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.vimtips.testshutdown/.MainActivity } I/ActivityManager( 132): Displayed activity com.vimtips.testshutdown/.MainActivity: 305 ms (total 305 ms) D/MainActivity( 1393): onPause called I/ActivityManager( 132): Displayed activity com.vimtips.testshutdown/.MainActivity: 302 ms (total 302 ms) D/MainActivity( 1393): Shutting down This doesn't appear to happen on a normal Activity, just an Activity group, though looking at Android's sourcecode, I can't figure out why. It's causing some serious problems with my app. Anyone know why this would happen?

    Read the article

  • errors when using c++ bison ---- in the file position.hh

    - by Eric
    firstly I'm not good at English so forgive me. I compile my program with the bison generated files in visual studio and get these errors: ...\position.hh(83): error C2589: '(' : illegal token on right side of '::' ...\position.hh(83): error C2059: syntax error : '::' ...\position.hh(83): error C2589: '(' : illegal token on right side of '::' ...\position.hh(83): error C2059: syntax error : '::' and the corresponding code is: inline void columns (int count = 1) { column = std::max (1u, column + count); } I think the problem is with std::max. If I change std::max to equivalent code then there is problem anymore, but is there a better solution instead of changing the generated code? here is the *.yy file I wrote. // // bison.yy // %skeleton "lalr1.cc" %require "2.4.2" %defines %define parser_class_name "cmd_parser" %locations %debug %error-verbose %code requires { class ParserDriver; } %parse-param { ParserDriver& driver } %lex-param { ParserDriver& driver } %union { struct ast *a; double d; struct symbol *s; struct symlist *sl; int fn; } %code { #include "helper_func.h" #include "ParserDriver.h" std::string error_msg = ""; } %token <d> NUMBER %token <s> NAME %token <fn> FUNC %token EOL %token IF THEN ELSE WHILE DO LET %token SYM_TABLE_OVERFLOW %token UNKNOWN_CHARACTER %nonassoc <fn> CMP %right '=' %left '+' '-' %left '*' '/' %nonassoc '|' UMINUS %type <a> exp stmt list explist %type <sl> symlist %{ extern int yylex(yy::cmd_parser::semantic_type *yylval, yy::cmd_parser::location_type* yylloc); %} %start calclist %% ... grammar rules ...

    Read the article

  • php - sort and delete duplicates?

    - by c41122ino
    I've got an array that looks like this: Array ( [0] => Array ( num => 09989, dis => 20 ) [1] => Array ( num => 09989, dis => 10 ) [2] => Array ( num => 56676, dis => 15 ) [3] => Array ( num => 44533, dis => 20 ) [4] => Array ( num => 44533, dis => 50 ) ) First, I'm trying to sort them by num, and can't seem to get the usort example from php.net working here. It simply doesn't appear to be sorting... I'm also trying to delete the array element if it's a duplicate and whose dis value is higher than the other one. So, based on the example above, I'm trying to create: Array ( [0] => Array ( num => 09989, dis => 10 ) [1] => Array ( num => 44533, dis => 20 ) [2] => Array ( num => 56676, dis => 15 ) ) This is the code from php.net: function cmp($a, $b) { if ($a == $b) { return 0; } return ($a < $b) ? -1 : 1; }

    Read the article

  • Why can't I add to the middle of an array with Perl's Tie::File?

    - by SCNCN2010
    File : #comment1 #comment2 #comment3 #START HERE a: [email protected] b: [email protected] my perl program : use Data::Dumper; use Tie::File; tie my @array, 'Tie::File', 'ala.txt' or die $!; my $rec = 'p: [email protected]'; my $flag =1 ; my $add_flag = 0; for my $i (0..$#array) { next if ($array[$i] =~ /^\s*$/); if ( $flag == 1 ) { if ($array[$i] =~ /#START HERE/ ) { $flag = 0; } else { next ; } } if (($array[$i] cmp $rec) == 1) { splice @array, $i, 0, $rec; $add_flag = 1; last ; } } if ( $add_flag == 0 ) { my $index = $#array+1; $array[$index] = $rec ; } the recording adding end of file always . I am trying to add to middle or begin or end like aplphbetical order Edit 2 : I want to do with Tie::FILE only . after add : (after 2 execution ) #comment1 #comment2 #comment3 #START HERE a: [email protected] b: [email protected] p: [email protected] a: [email protected] # if i add another record of a Expection : #comment1 #comment2 #comment3 #START HERE a: [email protected] a: [email protected] b: [email protected] p: [email protected] q: [email protected]

    Read the article

  • Traceroute comparison and statistics

    - by ben-casey
    I have a number of traceroutes that i need to compare against each other but i dont know the best way to do it, ive been told that hash maps are a good technique but i dont know how to implement them on my code. so far i have: FileInputStream fstream = new FileInputStream("traceroute.log"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; // reads lines in while ((strLine = br.readLine()) != null) { System.out.println(strLine); } and the output looks like this: Wed Mar 31 01:00:03 BST 2010 traceroute to www.bbc.co.uk (212.58.251.195), 30 hops max, 40 byte packets 1 139.222.0.1 (139.222.0.1) 0.873 ms 1.074 ms 1.162 ms 2 core-from-cmp.uea.ac.uk (10.0.0.1) 0.312 ms 0.350 ms 0.463 ms 3 ueaha1btm-from-uea1 (172.16.0.34) 0.791 ms 0.772 ms 1.238 ms 4 bound-from-ueahatop.uea.ac.uk (193.62.92.71) 5.094 ms 4.451 ms 4.441 ms 5 gi0-3.norw-rbr1.eastnet.ja.net (193.60.0.21) 4.426 ms 5.014 ms 4.389 ms 6 gi3-0-2.chel-rbr1.eastnet.ja.net (193.63.107.114) 6.055 ms 6.039 ms * 7 lond-sbr1.ja.net (146.97.40.45) 6.994 ms 7.493 ms 7.457 ms 8 so-6-0-0.lond-sbr4.ja.net (146.97.33.154) 8.206 ms 8.187 ms 8.234 ms 9 po1.lond-ban4.ja.net (146.97.35.110) 8.673 ms 6.294 ms 7.668 ms 10 bbc.lond-sbr4.ja.net (193.62.157.178) 6.303 ms 8.118 ms 8.107 ms 11 212.58.238.153 (212.58.238.153) 6.245 ms 8.066 ms 6.541 ms 12 212.58.239.62 (212.58.239.62) 7.023 ms 8.419 ms 7.068 ms what i need to do is compare this trace against another one just like it and look for the changes and time differences etc, then print a stats page.

    Read the article

  • Ignore case in Python strings

    - by Paul Oyster
    What is the easiest way to compare strings in Python, ignoring case? Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads). I guess I'm looking for an equivalent to C's stricmp(). [Some more context requested, so I'll demonstrate with a trivial example:] Suppose you want to sort a looong list of strings. You simply do theList.sort(). This is O(n * log(n)) string comparisons and no memory management (since all strings and list elements are some sort of smart pointers). You are happy. Now, you want to do the same, but ignore the case (let's simplify and say all strings are ascii, so locale issues can be ignored). You can do theList.sort(key=lambda s: s.lower()), but then you cause two new allocations per comparison, plus burden the garbage-collector with the duplicated (lowered) strings. Each such memory-management noise is orders-of-magnitude slower than simple string comparison. Now, with an in-place stricmp()-like function, you do: theList.sort(cmp=stricmp) and it is as fast and as memory-friendly as theList.sort(). You are happy again. The problem is any Python-based case-insensitive comparison involves implicit string duplications, so I was expecting to find a C-based comparisons (maybe in module string). Could not find anything like that, hence the question here. (Hope this clarifies the question).

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >