w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
C# Application does not crash in VS BUT CRASH on system running
Your program is likely throwing an exception, and it's getting written to the console, but you don't have anything from stopping the console from closing immediately after the message is written. Add a Console.ReadKey(); after your try/catch block.

Categories : C#

Database based audit log for web application needs user id
A temporary table seems overkill when you could just use a session setting. Up to version 9.1, custom session variables needed to be declared in postgresql.conf through the custom_variable_classes parameter, which made it a bit cumbersome, deployment-wise. Since 9.2, it's no longer necessary. So you could just issue at connect time: SET myapp.myusername='foobar'; and then in a trigger or in fact anywhere within the session, SELECT current_setting('myapp.myusername'), or SHOW myapp.myusername would get back the value.

Categories : SQL

Apply regional settings to application based on user profile
Most of the time, you shouldn't expose each and every detail of the culture format to your users. Instead, provide a drop-down list of cultures you want to support. Cultures are specified using codes. Some common codes are en-US (English/USA), es-MX (Spanish/Mexico) and de-DE (Germany/German). The first part refers to the language, and the second part refers to the specific country or region. Once you have the selected culture code, you can apply it to each user, such as: CultureInfo culture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = culture; If you are using culture-specific resource files, then you will also need: Thread.CurrentThread.CurrentUICulture = culture; There are several places you could do this, but a common location is in the Application_Beg

Categories : Asp Net Mvc

How to use xml with c# form application To get text for Lables Based on user Input from xml file
Consider dividing your problem in reading and writing XML in C# and look for each answer, also for setting you can use the Settings.Settings file and select User or Application if you want the setting to change or not. Build XML Read XML XPath Ream XML XmlReader, single pass Settings file

Categories : C#

Prompt user to enter path when application starts very first time. Run or stop application depending upon user's action (OK or Cancel)
Application.Exit() will exits the message loop only which is the loop after you call Application.Run .. If you want to exit from whole application- try Environment.Exit(0) It would just kill the process.

Categories : C#

How to detect application close when no form is present (console application)
You need to create a console control handler. There is no facility for doing that in the Console class, but you can call Windows API functions to do it. An example in C# is at Detecting Process Exit From Console Application in C#. You'll want to read and understand the SetConsoleCtrlHandler API function. I wrote a couple of articles a few years ago about using the Windows Console API from C#. Unfortunately, DevSource seems to have lost the one that describes this. The other two are available at http://www.devsource.com/c/a/Using-VS/Working-with-Console-Screen-Buffers-in-NET/ and http://www.devsource.com/c/a/Using-VS/Console-Input-in-NET/ Full source for the code presented in those articles is available at http://mischel.com/pubs/consoledotnet.zip.

Categories : Dotnet

Get log of Application Crash & ANR?
You can trap and log it manually, but this is usually solved by integrating crash handling and reporting services like TestFlight, New Relic, and other similar services. There are some self-hosted, open source tools like android-remote-stacktrace too. The libraries are set to capture any unhandled exception your application, log the exception to a remote server so you can view it without requiring the user to send it to you manually, and will then allow the original exception to be rethrown as normal. Android Handling the Unexpected also covers the idea in detail with some sample code if you really want to do it yourself. That post also lists several more example external services.

Categories : Android

Why does my application crash?
This is the main cause: Caused by: java.lang.IllegalThreadStateException: Thread already started. at java.lang.Thread.start(Thread.java:1227) at com.example.threadexample.ThreadExample.buttonClick(ThreadExample.java:60) You cannot reuse the same Thread object. You have to create a new Thread object before you call .start() again. From the documentation: It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.

Categories : Android

C++ application crash
what kind of issue is this Any crash inside malloc or free is a sure sign of previous heap corruption. Use Valgrind or AddressSanitizer (incorporated into GCC-4.8 as well) to find the root cause. Ignore vdso -- as Tom Tromey said, it has nothing to do with the problem.

Categories : C++

Strange crash of an application
Listview reuses rows views on scrolling instead of creating new one. So, in scrolling, your "convert" will not null and you will not run "name = (TextView) row.findViewById( R.id.product_name )" and "name" will leaves null. So, when you later will try to set text into name, you will get NullReferenceException. You should always init your widgets object by findViewById. Change your code and it should works good: @Override public View getView(int position, View convert, ViewGroup parent) { View row = convert; ImageView image = null; TextView name = null, price = null; if( row == null ) { LayoutInflater inflater = ((Activity) context).getLayoutInflater(); row = inflater.inflate( resource, parent, false ); } image = (ImageView) row.findViewById( R

Categories : Android

C#.Net X64 Application crash when using 64bit dll
I have finally resolved the problem. When I used Microsoft Debug Diagnostic Tool (from http://www.microsoft.com/en-gb/download/details.aspx?id=26798) the crash dump shows that there is a problem loading my external dll or its dependencies. I then loaded the my external dll into Dependency Walker (http://dependencywalker.com/) it shows that it can't find a dependency "msvcp100.dll" which is linked to Microsoft VC++. So I installed Microsoft re-distributable package (x64) and my app doesn't crash any more. Thanks every one for your help...

Categories : C#

Why does my Application crash at startup?
I see some flaw in your code. As far as I know, the ProgressBar value should be less than or equal to 100. You are setting it to (progress * 100) Also, once progress == 100, you hide the progress bar, this will take place when progress = 1. Then you hide the progress bar. Hope this helps. private ProgressBar mProgress; private int mProgressStatus = 0; mProgress = (ProgressBar) findViewById(R.id.progress_bar); // Start lengthy operation in a background thread new Thread(new Runnable() { public void run() { while (mProgressStatus < 100) { mProgressStatus = doWork(); // Update the progress bar mHandler.post(new Runnable() { public void run()

Categories : Java

Why does qwindows.dll from Qt5.0.2 cause my application to crash
Answering my own question... We had a batch script that automatically copied the relevant prebuilt qt dlls into our application's installation directory from subdirectories of the latest downloaded qt package's vs2010 directory. It appears that in Qt5.0.1, Qt dlls appeared in both the lib and bin subdirectories of msvc2010, whereas in Qt5.0.2, the Qt dlls appear only in the bin subdirectory. Since we were automatically copying dlls from the lib subdirectory, when we migrated to 5.0.2 nothing was copied and the old 5.0.1 dlls remained in our application's installation directory. The qwindows.dll file, however, is still located in msvc2010pluginsplatforms and so that did get updated and was not compatible with the old 5.0.1 dlls. I don't think that we did anything funny with the downloa

Categories : Windows

execl() causes an application crash
You forgot to null-terminate your list of arguments to execlp(). See e.g. http://linux.die.net/man/3/execlp or http://msdn.microsoft.com/en-us/library/vstudio/1kxct8h0.aspx.

Categories : C

Why action bar in titanium crash my application?
try wrapping it in onCreateOptionsMenu win.activity.onCreateOptionsMenu = function(e) { actionBar = win.activity.actionBar; if (actionBar) { alert("ACTIVITY"); actionBar.backgroundImage = "/images/bg_top.png"; actionBar.title = "New Title"; actionBar.onHomeIconItemSelected = function() { Ti.API.info("Home icon clicked!"); }; } else { alert('missing action bar'); } });

Categories : Android

Application crash on new thread starts
void MainWindow::opthread(){ newthread th; th.start(); } You are creating the thread object on the stack. He will be destroyed when the function opthread returns. And from the Qt documentation : Deleting a running QThread (i.e. isFinished() returns false) will probably result in a program crash. Wait for the finished() signal before deleting the QThread. You need to provide a greater lifespan for your newthread object. waiting for it to be finished is not an option, as it will result in a sequential execution. Either you use class members or you allocate your thread objects on the heap. Personal opinion: Not only sub-classing QThread is not the most appropriate method of getting it done, I believe you don't need a thread at all.

Categories : C++

linux application crash due to Out of memory
2013 Jun 18 16:30:53+00:00 sys-nam kernel [warning] [<ffffffff802ffddc>] out_of_memory+0x74/0xe8 2013 Jun 18 16:30:53+00:00 sys-nam kernel [warning] [<ffffffff80304588>] __alloc_pages_nodemask+0x718/0x730 Most likely you are running out of heap space due to calls to new, malloc, allocate, or the like, as the error occurs during calls to the __alloc_pages_nodemask routine. Look in your code for all instances of code that allocates heap memory and ensure that the memory is getting released when you are finished using it.

Categories : C++

Crash Debugging Win32 Application
0:000> ?@esi+@edi Evaluate expression: 36278408 = 02299088 0:000> !address 02299088 ProcessParametrs 00311020 in range 00310000 00410000 Environment 02294848 in range 02290000 02390000 02290000 : 02290000 - 00100000 Type 00020000 MEM_PRIVATE Protect 00000004 PAGE_READWRITE State 00001000 MEM_COMMIT Usage RegionUsageHeap Handle 00310000

Categories : Debugging

iOS MediaPlayer makes application crash
I see this whenever I have an outlet or action that is no longer hooked up properly. 1.) Open storyboard 2.) Select playButton 3.) Remove all outlets and actions from this item 4.) Remove plugs from your class that were previously attached (especially in dealloc) 5.) Create new outlet and control-drag from the storyboard to your class. Good to go. -A little overkill but gets the job done for me everytime.

Categories : IOS

Timer ends = application crash
Why don't you use a CountDownTimer ? It seems more suitable to your task and it handles all the callbacks on the UI thread for you.

Categories : Android

WPF event that occurs after application crash
1) there are two event handlers: Dispatcher.UnhandledException += Dispatcher_UnhandledException; All unhandled exceptions in UI thread. AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; All other exceptions ... 2) there is no way to catch the situation when your app is killed through ALT+CTR+DELETE The only Idea I can think of... create a watch dog app that checks the status of main app...

Categories : C#

how to detect recreate after crash vs. recreate after normal activity destruction
I don't think there is a way as such but I don't believe that the onStop or OnDestroy is called when the activity crashes but not 100% sure. If it doesn't, then in the onStop or onDestroy set a shared preference i.e. shutdownCorrectly which is set to true. Then when the activity opens, check that the shared preference shutdownCorrectly run your normal code and set the shared preference to false. If the shared preference is false when you check, then it means the app crashed so you can run other code. Hope this helps.

Categories : Android

Application Crash on Fast switching between UISegment
Please post the error log, if it is array out of bounds exception I suspect these two methods - (void)fetchedData:(NSData *)responseData & your tableViewDatasource To find which line of code causes this crash do this. Go to break points tab on the left side and click + in the bottom. Then you would get something like this: Just hit done, run your code again and tell us which line caused the exception. I understood your problem, why do you want to take the URL from the array in this function - (void) displayingSmallImage:(NSIndexPath *)indexPath you could pass the Url to load to that function, from cellForRowAtIndex like this: NSArray *argsToPass=[NSArray arrayWithObjects:indexPath,self.feedsArray[indexPath.row][@"icon_url"]]; [NSThread detachNewThreadSelector:@

Categories : Iphone

ios Application crash : failed to resume in time
0x8badf00d: This code indicates that an application was terminated by iOS because a watchdog timeout occurred. Basically, the application took too long to launch, terminate, or respond to system events. You're doing something that takes too long. Look at the backtrace and try to symbolicate it (convert from the hexidecimal addresses in the executable code to method names and line numbers) so that you can understand where the problem is. This thread should help you out there. Demystifying iOS App Crashes is a tutorial I found very useful.

Categories : IOS

crash application while delete section from UITableView
I guess the numberOfSectionsInTableView: returns the previous number of sections. You must make sure that what you tell the table view to do also happens in the data source. That is, if you delete a section, then the numberOfSectionsInTableView must also return a number one less than before. The same stands for cells and everything else. This is probably described in the error you get.

Categories : Objective C

Android Application Crash on button event
change String s=E1.toString(); String m=E2.toString(); to String s=E1.getText().toString(); String m=E2.getText().toString(); for getting text from EditText's on Button Click. currently you are trying to parse View's as Integer

Categories : Android

OpenCV application crash related to libstdc++-6.dll
Turns out it was not due to the libstdc++-6.dll. The answer of the related thread: OpenVC 2.4.5, eclipse CDT Juno, MinGW error 0xc0000005 actually had solved my problem. I didn't succeed because I left both the pre-built (that came along with opencv download) opencv libraries (*.dll) and the re-built (according to the above solution) libraries exposed under system path. As a result, my program used the pre-built version and ignored the new builds. After I replaced the pre-built *.dll's with the re-built ones, the program ran without any issue.

Categories : C++

Android : Application with Crash dump report
I suggest to take a look at ACRA. https://github.com/ACRA/acra At least if you don't want to use it, it's still open source so you can take a look at the code. They do a lot of thing you want to achieve and when looking at the code you may find answers to your question. I forked ACRA to make some of the things you mention in your questions : How do I get the logfile from an Android device? You can log into the acra report file everything you want. We use a special logger that write into the acra logfile. So we know what is the sequence of events that triggered the crash. Programmatically get log cat data It's a text file, we use [sections] and timestamp/key=value to display logs to the users before sending the report. Be careful to anonymize your log reports and do not put

Categories : Android

onResume() makes my application crash with no reason
you must complete the life cycle of android activity. If you are override onResume() or any method of the life cycle you should call the super.onResume(); public void onResume(){ super.onResume(); /// Your Code } UPDATE Condition you checking is onResume() method is incorrect. if(play) // UPDATE HERE { if(!playing)// UPDATE HERE { if(numbl>0) { letter=thefull.substring(cur, cur+1); if(letter.equals("m")) { oursong = MediaPlayer.create(MainActivity.this, R.raw.m); oursong.start(); playing=true; } else if(letter.equals("a")) { oursong = MediaPlay

Categories : Java

Application crash for unknown reasons on WinXP
Here's another way to track this down without Delphi on the VM... Copy your project. Remove all the units from Project Source except your main form. Launch your application from XP see if it crashes. If it crashes...then look at the units being dragged in from your main form...start removing them until your program stops crashing. If it doesn't crash...start adding units/forms back into your project source until it crashes. Do you have JCL/JVCL installed(JEDI)? If so create a Logger...note the Logger needs to be created and hooked before your MainForm code executes...You will also need to set up a detailed Stack Trace from Unhandled Exceptions, in Delphi select->Project/Options/Linker/Map file/Detailed} You will need something like this in your Logger unit procedure HookGlobalExcep

Categories : Delphi

iOS Subview button causing application to crash
Sounds like its been dealloc'ed on you. Try turning on Zombie mode, crash the app again and see if it points you to whats going on, it will tell which object is trying to do something after being released. Xcode -> Click your scheme -> Edit Scheme -> Run -> Diagnostics -> Tick Enable Zombie Objects Another thing to try is to watch your subView in the debug area, this will tell you when your subView is released. Example of setting watch Also if you have not already tried it, try keep a strong/retain reference to your subview. If you can't get it working post the code you create the view with. EDIT: in .h @property (nonatomic, strong) PickupTimeViewController *pickupTimeView; in .m self.pickupTimeView = [[PickupTimeViewController alloc]init]; [selectedView addChildViewControl

Categories : IOS

MAC Application crash on button click event
It looks like you're sending a btnClicked message to a NSString object. Can you post the code where you call [... bntClicked] ? The behaviour you are describing can mean either that the viewController implementing the btnClicked method gets deallocated before the action is called or that the action in interface builder is not set correctly. You should add a log statement in the dealloc method of the viewController implementing the btnClicked and see that it does not get deallocated before the action is called. If you're using ARC make sure that you have a member data pointing to your view controllers so they don't get released. Also you should delete the ibaction association in interface builder and do it again making sure that you connect the button to the correct view controller.

Categories : Objective C

CFRelease causing crash in iPad application
UIGraphicsGetImageFromCurrentImageContext() returns a UIImage *, not a CGImageRef. And you don't own the resulting UIImage, so you don't want to release it (or CFRelease() it). try: UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext(); instead.

Categories : IOS

Why do minor errors crash my SproutCore application?
Web developers are used to being able to let minor errors go unnoticed. This is appropriate: since short-lived websites often have minimal local state to maintain, many minor errors won't impact the user experience, so it may not be worth the development time required to fix them. Application developers, on the other hand, are used to having to carefully handle errors. In desktop .NET or Cocoa, for example, the operating system will proactively crash an application that throws an unhandled error. This is because applications generally assume that they are long-lived, and have to manage an internally-consistent state. An error is a sign that this internal state has likely become unmanaged & unstable, and in order to prevent unexpected (or worse) behavior, the application must be termin

Categories : Misc

Google Maps Android API v2 application crash
There is some kind of mismatch between the package you specified in your Manifest file and the package you have provided for the Activities in it. try to change: <activity android:name="in.wptrafficanalyzer.locationgooglemapv2demo.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> to: <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.cat

Categories : Android

Using user defined runtime attributes let the app crash
The exception you are describing is almost always related to a problem in interface-builder links. Go over the outlets and make sure that they are all linked to their respective object. Hunch: toggleType has a defined link but isn't defined in the class code. If you view the links in the storyboard, it will have a yellow warning sign next to it (right click on file's owner to inspect all relations).

Categories : Iphone

Canvas view crash the application on touch events
It looks like mScaleDetector is only initialized in one of the constructor. It should be initialized in all constructors. A common pattern is to create an init() method and place all you initializing in there then call that method from all constructors. Note: It's always helpful to post a StackTrace... You should be able to see which constructor got called.

Categories : Android

Restore Windows application crash Debug button
Found in this answer. Go to the Tools | Options | Debugging | Just-In-Time dialog. Then make sure all Native and Managed (if you're debugging a .NET application) are checked. Next time you get a crash, the Visual Studio Just-In-Time debugger will come up. And this restores automatically the Debug button:

Categories : Visual Studio

MadExcept for delphi is not printing stacktrace after application crash
The reason why madExcept is not handling the exception is because you already caught it with on E:Exception do handling it yourself. Just give madExcept.HandleExcept the exception to handle it: madExcept.HandleException(etNormal, E);

Categories : Delphi

Unrecognized selector sent to instance and crash in main.m in iOS application
The error message -[UITableViewController setDetails:]: unrecognized selector ... shows that detailViewController is not an instance of AppTestDetailViewController as you expect, but "only" a UITableViewController. One possible reason could be that you did not set the "Custom Class" for the controller in the storyboard file.

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.