Has anyone seen this weird value while handling sin / cos/ tan / acos.. math stuff?
===THE WEIRD VALUE===
-1.#IND00
=====================
void inverse_pos(double x, double y, double& theta_one, double& theta_two)
{
// Assume that L1 = 350 and L2 = 250
double B = sqrt(x*x + y*y);
double angle_beta = atan2(y, x);
dou...
Consider the following code where LockDevice() could possibly fail and throw an exception on ist own. What happens in C# if an exception is raised from within a finally block?
UnlockDevice();
try
{
DoSomethingWithDevice();
}
finally
{
LockDevice(); // can fail with an exception
}
...
Hi,
I am trying to use JMX to monitor the status of my application, in particular to track any exceptions that are thrown during my application's runtime.
However, I cannot seem to find any existing APIs that can retrieve the exceptions thrown. I went as far as getting a thread's stacktrace but there ain't any exception info captured. ...
What is the most appropriate .Net exception type for when you have a class which must have its collection property initialised with at least one item?
I'm thinking that it would be an ArgumentOutOfRangeException but is there something more appropriate based on a collection?
...
I keep getting the following error:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="FEDivaNET"
StackTrace:
at Diva.Handles.FEDivaObject.dropReference()
at Diva.Handles.FEDivaObject.!FEDivaObject()
...
Probably a trivial question, but in which order does Exception::getTrace return calls? Most recent first or last? I'd like to know before I implement my error handler.
BenTheDesigner
...
Hi Everyone,
Can someone tell me why this unit test that checks for exceptions fails? Obviously my real test is checking other code but I'm using Int32.Parse to show the issue.
[Test]
public void MyTest()
{
Assert.That(Int32.Parse("abc"), Throws.Exception.TypeOf<FormatException>());
}
The test fails, giving this error. Obviousl...
Hi!
I'm developing an outlook 2003 add-in. Until now I used only winforms to display one form, but today I've added a WPF window for more complex stuff. DUe to the WPF window, a COM exception is being thrown when outlook shuts down.
Does anybody know why? I need to start a separate thread for the WPF window in single apartment state.
...
i am working project in c# Visual studio 2009,i am using c++ dll in my project and also i call that dll through my function . In my system the project run successfully.but in other system not in single system more than system i checked it shows exception like unable to load dll. i am check that dll in dependency walker it shows msvcr71.d...
Take this method
/**
* @return List of group IDs the person belongs to
*
*/
public List<String> getGroups() {
if (this.getId().equals("")) return null;
}
I would like to throw exception instead returning null, what's the exception to throw when an important parameter/dependency has not been set?
...
One feature I really liked in Java that isn't in C# is checked exceptions. Is there any way to simulate (maybe via stylecop?) or turn on checked exceptions in Visual Studio?
Yes I know a lot of people dislike them, but I find they can be helpful.
...
I'm running this C# code in Visual Studio in debug mode:
public class MyHandlerFactory : IHttpHandlerFactory
{
private static Dictionary<string, bool> myDictionary = new Dictionary<string, bool>();
static MyHandlerFactory()
{
myDictionary.Add("someKey",true);
myDictionary.Add("someKey",true); // fails due to duplicate key
...
I have a gridview and, when a record is double-clicked, I want it to open up a new detail-view form for that particular record.
As an example, I have created a Customer class:
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.SqlClient;
using Sy...
In another question, the accepted answer suggested replacing a (very cheap) if statement in Python code with a try/except block to improve performance.
Coding style issues aside, and assuming that the exception is never triggered, how much difference does it make (performance-wise) to have an exception handler, versus not having one, ve...
Hey,
I'm new in Silverlight and i am doing some tests. With my current test I try to display in real time the current Clipboard content. But there is a weird behaviors with this code :
namespace SilverlightTest
{
public partial class MainPage : UserControl
{
private Timer _timer;
public MainPage()
{
InitializeCompo...
I have a class that wraps List<>
I have GetValue by index method:
public RenderedImageInfo GetValue(int index)
{
list[index].LastRetrieved = DateTime.Now;
return list[index];
}
If the user requests an index that is out of range, this will throw an ArgumentOutOfRangeException .
Should I just let this happe...
In Linq to SQL SubmitChanges(ConflictMode.ContinueInConflict) i get Exception:
"String or binary data would be truncated.
The statement has been terminated."
But how to figure out the Property causing this? I guess i could start testing 1 by 1 the properties but what will happen if i have numerous properties?
...
What factors dictate throwing an exception if argument is null (eg if (a is null) throw new ArgumentNullException() ), as opposed to checking the argument if it is null beforehand.
I don't see why the exception should be thrown rather than checking for null in the first place? What benefit is there in the throw exception approach?
This...
In the following C++ code, it should be impossible for ain integer division by zero to occur:
// gradedUnits and totalGrades are both of type int
if (gradedUnits == 0) {
return 0;
} else {
return totalGrades/gradedUnits; //call stack points to this line
}
however Visual Studio is popping up this error:
Unhandled exception ...
One of our users having an Exception on our product startup.
She has sent us the following error message from Windows:
Problem Event Name: APPCRASH
Application Name: program.exe
Application Version: 1.0.0.1
Application Timestamp: 4ba62004
...