for (i=1; i<=4; i++) {
try {
timer = document.getElementById("timer"+i).parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].className;
}
catch(e) {
FM_log("aguardaReforcos()", "ERRO - timer"+i);
}
...
I have to it this way with try because otherwise I get...
Hi,
I'm curious if anyone knows how I can save the current state of a php application (the one that is currently in memory, with everything including declared variables, $_POST, $_GET) when an error occurs?
Currently Zend Server does this. by monitoring the application and saving the snapshot of the php's memory etc. and shows a log r...
To detect and prevent shutdown the computer I use very simple program. It has only one form and one private procedure like below:
TForm3 = class(TForm)
private
procedure WMQueryEndSession(var Msg : TWMQueryEndSession) ;
message WM_QueryEndSession;
end;
and the implementation
procedure TForm3.WMQueryEndSession(var Msg: TWM...
One is to use C++ exceptions: try catch blocks. But freeing dynamic memory will be an issue when an exception is raised.
Second is to use C style: errno variable
Third is just to return -1 on error and 0 on success :)
Which way should be chosen for a mid-size project and why? Any other better approach..?
...
I am reading a file containing around 50k lines using the file() function in Php. However, its giving a out of memory error since the contents of the file are stored in the memory as an array. Is there any other way?
Also, the lengths of the lines stored are variable.
@gordon : Here's the code. Also the file is 700kB not mB.
private...
I'm looking for some thoughts/opinions on architecture for a layer of code that invokes methods in an API. In my case, the calling code is C#/.NET and the API is part of an unmanaged legacy DLL. But the same question could apply in many different languages/environments.
I'm basically writing a managed wrapper around an unmanaged API. ...
I have a custom PHP error handler in my application, which displays a friendly error message to the user and logs the error for me to fix.
However, I've noticed since implementing it that when an error occurs in one page, the error is reported from users on unrelated parts of the site. Say it's a error in /some_site_section/view_one.ph...
I am a newbie at Java, but decided to make a application that has a bunch of balls bouncing around. Please keep in mind that I know almost nothing about normals, which I have seen mentioned a lot in this kind of thread. I have also only take Algebra 1, and know a little bit of trig (sin, cosin and tangent). Anyways...
I have collision d...
Hello,
I have created a new MVC Application in VS2010 straight out the box. In the Home Controller I have ther following:
[HandleError(View = "Error")]
public ActionResult Index()
{
int num1 = 0;
int num2 = 5;
int result = num2 / num1;
return View();
}
This creates an error and a d...
Trying to implement the new FP 10.1 Global error handler into my projects but no matter what I do any uncaught error will still show up the Exception window (both in debug and release versions of the SWF). All I want to do is to prevent these popups but instead send a message to my logger. Here's my code ...
EDIT: I simplified the code ...
I've got some UI code that looks like this:
try
{
SomeClass classInstance = new SomeClass(someId);
}
catch (Exception exception)
{
// Content wasn't created, show a message, stop processing
return;
}
It seems the try catch was added because the constructor for SomeClass would bomb out if the someId it receives isn't valid,...
I used a httpservice which returns a xml as a result.But the content itself has a '<' symbol or '>' symbol , it leads to error ! How can i handle this?
Thanks in advance.
...
We have 2 sets of prices, $ and £'s.
How best can I handle this.
Should I have a folder with the US site in so when users click on the US flag they go to mydomain.com/us and then navigate from there.
Or is there something simpler I can do?
The HTML site passes users over to our client system when ordering so currency conversion etc i...
I'm developing the Java Swing application. I'm quite new to Java, so got some questions. I have a modal window with some set of controls (text fields, buttons etc).
I want to handle click on the button in the parent window. I think the most efficient and accurate way is first to handle it in modal window, then raise some another event ...
What is the right way of working with optional APIs in Java Mobile?
Does one need to make different versions of their app?
Or is it enough to check APIs availability at runtime using System.getProperty()?
Let's say I'd like my app to support JSR-256 (the Sensor API). Would importing classes from javax.microedition.sensor and register...
Hi all,
This question is about a C++ library for Windows and we use Visual C++ as our compiler.
We enable exception handling compiler option in our library. We also use throw/catch in a few places.
One of our customers says that they disable exception handling option in their application. Now the question is, whether they would exper...
I'm making a SOAP handler that will be secured with X509 Certificates, and one of the requirements is that the program log as much as possible in an existing log viewer. Obviously, there are a lot of errors surrounding certificates that are handled at the IIS level, which in this case is not acceptable.
I already have the logging part ...
Hi
I'm newbie when talks about Error Handling. It's a subject that i want to study but right now i just don't have free time, so i'm looking to implement an error/exception handler one a few projects i've developing last weeks (C#, .NET 3.5).
What do you recommend me to implement for this? Other point is where to store the errors logs....
I have a contact form and I handle errors by checking each field one-by-one with an "if" statement. I find this hard and I can't seem to find a better/more productive way to get them working. I would also like a heading saying "Error" if one (or more) is true. But I cant get them to work with the separate "if" statements.
Here is my cod...
Hi. I'm using ifstream and ofstream operations in DEV c++ but they don't seem to work correctly. I've been trying to write a little prime generator code but it doesn't work :\ When I display fstream::tellg() at any point, it displays -1. Please check the code. Thanx.
#include<iostream>
#include<math.h>
#include<fstream>
using namespace ...