f



Understanding error masking in error handling...

Hey all :)

I was wondering about the $error_types (I particularly notice the 's' suffix
when reading the manual) parameter for 'set_error_handler()':

Can be used to mask the triggering of the error_handler  function just like
the error_reporting ini setting controls which errors are shown. Without
this mask set the error_handler  will be called for every error regardless
to the setting of the error_reporting setting. 

And, in my php.ini I have,
error_reporting  =  E_ALL & ~E_NOTICE

Which - I think - means something like "E_ALL and less severe AND NOT
E_NOTICE in particular".

This may be read wrong, but in essence, what I assume is possible is to
create a mask that very particularly lets you define which errors to handle
with your custom error handler, and which not to. But I cannot find any
documentation telling me how this works.

I would like, rather than having to do something like -

if (DEVELOPMENT_MODE && in_array($error_level, array(E_WARNING,
E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_RECOVERABLE_ERROR,
E_DEPRECATED, E_USER_DEPRECATED)) log_to_screen($message);

- on every error/notice/whatever comes by my custom error handler, to be
able to specify a mask that essentially does the same only in my
set_error_handler call.

This may seem superfluous, but what I'm creating right now are core services
that should service upwards of hundreds of frontends simultaneously, so
whatever small performance gain I can achieve here and there may lead to a
tremendous effect overall.

Can anyone help me with understanding this masking business? Or I have I
misunderstood the concept entirely? :)

Thanks in advance,
Daniel :)
0
daniel138 (30)
11/7/2008 8:41:28 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

9 Replies
1141 Views

Similar Articles

[PageSpeed] 12

Daniel Smedegaard Buus schreef:
> Hey all :)
> 
> I was wondering about the $error_types (I particularly notice the 's' suffix
> when reading the manual) parameter for 'set_error_handler()':
> 
> Can be used to mask the triggering of the error_handler  function just like
> the error_reporting ini setting controls which errors are shown. Without
> this mask set the error_handler  will be called for every error regardless
> to the setting of the error_reporting setting. 
> 
> And, in my php.ini I have,
> error_reporting  =  E_ALL & ~E_NOTICE
> 
> Which - I think - means something like "E_ALL and less severe AND NOT
> E_NOTICE in particular".
> 
> This may be read wrong, but in essence, what I assume is possible is to
> create a mask that very particularly lets you define which errors to handle
> with your custom error handler, and which not to. But I cannot find any
> documentation telling me how this works.
> 
> I would like, rather than having to do something like -
> 
> if (DEVELOPMENT_MODE && in_array($error_level, array(E_WARNING,
> E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_RECOVERABLE_ERROR,
> E_DEPRECATED, E_USER_DEPRECATED)) log_to_screen($message);
> 
> - on every error/notice/whatever comes by my custom error handler, to be
> able to specify a mask that essentially does the same only in my
> set_error_handler call.
> 
> This may seem superfluous, but what I'm creating right now are core services
> that should service upwards of hundreds of frontends simultaneously, so
> whatever small performance gain I can achieve here and there may lead to a
> tremendous effect overall.
> 
> Can anyone help me with understanding this masking business? Or I have I
> misunderstood the concept entirely? :)
> 
> Thanks in advance,
> Daniel :)

Hi Daniel,

I think you need to reread the manual:
http://nl3.php.net/manual/en/function.set-error-handler.php

[quote]
It is important to remember that the standard PHP error handler is 
completely bypassed. error_reporting() settings will have no effect and 
your error handler will be called regardless - however you are still 
able to read the current value of error_reporting and act appropriately. 
Of particular note is that this value will be 0 if the statement that 
caused the error was prepended by the @ error-control operator.
[/quote]

So your custom errorhandler is called ALWAYS regardless the settings you 
put into error_reporting() (or via php.ini).

Your errorhandler must deal with this error then.
The errorhandler is called with a bunch of parameters, the first being 
the errornumber as listed here:
http://nl3.php.net/manual/en/function.error-reporting.php

So I am unsure why you care about the 'masking business', since it is of 
no concern to you (unless I completely misinterpret your posting).

The passed errornumber can only be 1 of the errors listed (You cannot 
have 2 errors at the same time).

Also, if you write your own handler, be sure you check for errorsupression.

Here is the first peice of code of an errorhandler I use often:

function errorHandler($number, $string, $file, $line, $context)  {
// If the user uses errorsurperrsion with @, we need to forgive this error!
  if (error_reporting() == 0){
    // The error was surpressed, return without futher interference.
    return;	
  }
// rest of the errorhandler

}	

Good luck,

Regards,
Erwin Moller

-- 
"There are two ways of constructing a software design: One way is to 
make it so simple that there are obviously no deficiencies, and the 
other way is to make it so complicated that there are no obvious 
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
0
11/7/2008 1:05:24 PM
Erwin Moller wrote:

> Daniel Smedegaard Buus schreef:
>> Hey all :)
>> 
>> I was wondering about the $error_types (I particularly notice the 's'
>> suffix when reading the manual) parameter for 'set_error_handler()':
>> 
>> Can be used to mask the triggering of the error_handler  function just
>> like the error_reporting ini setting controls which errors are shown.
>> Without
>> this mask set the error_handler  will be called for every error
>> regardless to the setting of the error_reporting setting.
>> 
>> And, in my php.ini I have,
>> error_reporting  =  E_ALL & ~E_NOTICE
>> 
>> Which - I think - means something like "E_ALL and less severe AND NOT
>> E_NOTICE in particular".
>> 
>> This may be read wrong, but in essence, what I assume is possible is to
>> create a mask that very particularly lets you define which errors to
>> handle with your custom error handler, and which not to. But I cannot
>> find any documentation telling me how this works.
>> 
>> I would like, rather than having to do something like -
>> 
>> if (DEVELOPMENT_MODE && in_array($error_level, array(E_WARNING,
>> E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_RECOVERABLE_ERROR,
>> E_DEPRECATED, E_USER_DEPRECATED)) log_to_screen($message);
>> 
>> - on every error/notice/whatever comes by my custom error handler, to be
>> able to specify a mask that essentially does the same only in my
>> set_error_handler call.
>> 
>> This may seem superfluous, but what I'm creating right now are core
>> services that should service upwards of hundreds of frontends
>> simultaneously, so whatever small performance gain I can achieve here and
>> there may lead to a tremendous effect overall.
>> 
>> Can anyone help me with understanding this masking business? Or I have I
>> misunderstood the concept entirely? :)
>> 
>> Thanks in advance,
>> Daniel :)
> 
> Hi Daniel,
> 
> I think you need to reread the manual:
> http://nl3.php.net/manual/en/function.set-error-handler.php
> 
> [quote]
> It is important to remember that the standard PHP error handler is
> completely bypassed. error_reporting() settings will have no effect and
> your error handler will be called regardless - however you are still
> able to read the current value of error_reporting and act appropriately.
> Of particular note is that this value will be 0 if the statement that
> caused the error was prepended by the @ error-control operator.
> [/quote]
> 

Actually, I did read the manual ;) and this part too, but I'm not using
error_reporting(), I'm referring to the last parameter in
set_error_handler(callback $error_handler [, int $error_types]), which is,
and I quote (http://dk2.php.net/set_error_handler),

[quote]
error_types

Can be used to mask the triggering of the error_handler function just like
the error_reporting ini setting controls which errors are shown. Without
this mask set the error_handler  will be called for every error regardless
to the setting of the error_reporting setting.
[/quote]

Which is, in fact, the same quote as in my previous post ;) So, this has the
same effect as error_reporting() would have on the built-in error handler,
only on the custom one.

> So your custom errorhandler is called ALWAYS regardless the settings you
> put into error_reporting() (or via php.ini).
> 
> Your errorhandler must deal with this error then.
> The errorhandler is called with a bunch of parameters, the first being
> the errornumber as listed here:
> http://nl3.php.net/manual/en/function.error-reporting.php
> 
> So I am unsure why you care about the 'masking business', since it is of
> no concern to you (unless I completely misinterpret your posting).
> 
> The passed errornumber can only be 1 of the errors listed (You cannot
> have 2 errors at the same time).
> 
> Also, if you write your own handler, be sure you check for
> errorsupression.
> 
> Here is the first peice of code of an errorhandler I use often:
> 
> function errorHandler($number, $string, $file, $line, $context)  {
> // If the user uses errorsurperrsion with @, we need to forgive this
> error!
>   if (error_reporting() == 0){
>     // The error was surpressed, return without futher interference.
>     return;
>   }
> // rest of the errorhandler
> 

I did not know of this. Very useful tip! I have previously turned
error_reporting on and off on-the-fly to achieve the same! Thank you very
much :)

Daniel

> }
> 
> Good luck,
> 
> Regards,
> Erwin Moller
> 

0
daniel138 (30)
11/7/2008 4:37:54 PM
Daniel Smedegaard Buus schreef:
> Erwin Moller wrote:
> 
>> Daniel Smedegaard Buus schreef:
>>> Hey all :)
>>>
>>> I was wondering about the $error_types (I particularly notice the 's'
>>> suffix when reading the manual) parameter for 'set_error_handler()':
>>>
>>> Can be used to mask the triggering of the error_handler  function just
>>> like the error_reporting ini setting controls which errors are shown.
>>> Without
>>> this mask set the error_handler  will be called for every error
>>> regardless to the setting of the error_reporting setting.
>>>
>>> And, in my php.ini I have,
>>> error_reporting  =  E_ALL & ~E_NOTICE
>>>
>>> Which - I think - means something like "E_ALL and less severe AND NOT
>>> E_NOTICE in particular".
>>>
>>> This may be read wrong, but in essence, what I assume is possible is to
>>> create a mask that very particularly lets you define which errors to
>>> handle with your custom error handler, and which not to. But I cannot
>>> find any documentation telling me how this works.
>>>
>>> I would like, rather than having to do something like -
>>>
>>> if (DEVELOPMENT_MODE && in_array($error_level, array(E_WARNING,
>>> E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, E_RECOVERABLE_ERROR,
>>> E_DEPRECATED, E_USER_DEPRECATED)) log_to_screen($message);
>>>
>>> - on every error/notice/whatever comes by my custom error handler, to be
>>> able to specify a mask that essentially does the same only in my
>>> set_error_handler call.
>>>
>>> This may seem superfluous, but what I'm creating right now are core
>>> services that should service upwards of hundreds of frontends
>>> simultaneously, so whatever small performance gain I can achieve here and
>>> there may lead to a tremendous effect overall.
>>>
>>> Can anyone help me with understanding this masking business? Or I have I
>>> misunderstood the concept entirely? :)
>>>
>>> Thanks in advance,
>>> Daniel :)
>> Hi Daniel,
>>
>> I think you need to reread the manual:
>> http://nl3.php.net/manual/en/function.set-error-handler.php
>>
>> [quote]
>> It is important to remember that the standard PHP error handler is
>> completely bypassed. error_reporting() settings will have no effect and
>> your error handler will be called regardless - however you are still
>> able to read the current value of error_reporting and act appropriately.
>> Of particular note is that this value will be 0 if the statement that
>> caused the error was prepended by the @ error-control operator.
>> [/quote]
>>
> 
> Actually, I did read the manual ;) and this part too, but I'm not using
> error_reporting(), I'm referring to the last parameter in
> set_error_handler(callback $error_handler [, int $error_types]), which is,
> and I quote (http://dk2.php.net/set_error_handler),
> 
> [quote]
> error_types
> 
> Can be used to mask the triggering of the error_handler function just like
> the error_reporting ini setting controls which errors are shown. Without
> this mask set the error_handler  will be called for every error regardless
> to the setting of the error_reporting setting.
> [/quote]
> 
> Which is, in fact, the same quote as in my previous post ;) So, this has the
> same effect as error_reporting() would have on the built-in error handler,
> only on the custom one.

Hi,

Sorry to be so thick, but I do not understand what your problem is then.
You can overrule the default errorhandler (with its associated default 
error_reporting levels) with you own customn errorhandler (with it 
associated error_reporting levels passed to the function.).

This is your core 'problem', right?:
[quote]
- on every error/notice/whatever comes by my custom error handler, to be 
  able to specify a mask that essentially does the same only in my 
set_error_handler call.
[/qoute]

So you pass a value to it for the mask:
(as defined here: http://nl3.php.net/manual/en/function.error-reporting.php)
value  	constant
1 	E_ERROR
2 	E_WARNING
4 	E_PARSE
8 	E_NOTICE
16 	E_CORE_ERROR
32 	E_CORE_WARNING
64 	E_COMPILE_ERROR
128 	E_COMPILE_WARNING
256 	E_USER_ERROR
512 	E_USER_WARNING
1024 	E_USER_NOTICE
6143 	E_ALL
2048 	E_STRICT
4096 	E_RECOVERABLE_ERROR
8192 	E_DEPRECATED
16384 	E_USER_DEPRECATED

So, for example,  if you want to catch E_WARNING and E_NOTICE: you look 
up their values, add them, and pass that value. In this case 2+8=12.

But I have this feeling that I still don't understand what your problem 
is. ;-)

<snip>

>> Also, if you write your own handler, be sure you check for
>> errorsupression.
>>
>> Here is the first peice of code of an errorhandler I use often:
>>
>> function errorHandler($number, $string, $file, $line, $context)  {
>> // If the user uses errorsurperrsion with @, we need to forgive this
>> error!
>>   if (error_reporting() == 0){
>>     // The error was surpressed, return without futher interference.
>>     return;
>>   }
>> // rest of the errorhandler
>>
> 
> I did not know of this. Very useful tip! I have previously turned
> error_reporting on and off on-the-fly to achieve the same! Thank you very
> much :)
> 

Glad to hear that.
I found the solution to this 'problem' the hard way: ADODB (my favorite 
database abstractionlayer) created errors in my application. When I 
removed my own errorhandling the error were gone.
So I look at the line where the error originated, and they all had a @ 
in them. So I reread the whole errorhandling thingy on php.net, and it 
actually says it quite clearly. But appearantly you missed it too.
Methinks the editors should put that part in BOLD. ;-)

Regards,
Erwin Moller


-- 
"There are two ways of constructing a software design: One way is to 
make it so simple that there are obviously no deficiencies, and the 
other way is to make it so complicated that there are no obvious 
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
0
11/10/2008 10:43:23 AM
Erwin Moller wrote:

> Hi,
> 
> Sorry to be so thick, but I do not understand what your problem is then.

Hehe, no worries, I may very well be the one who is thick here (in addition
to me putting on a few early Christmas pounds), because my whole problem is
basically that I don't understand the whole masking business :)

> You can overrule the default errorhandler (with its associated default
> error_reporting levels) with you own customn errorhandler (with it
> associated error_reporting levels passed to the function.).
> 
> This is your core 'problem', right?:
> [quote]
> - on every error/notice/whatever comes by my custom error handler, to be
>   able to specify a mask that essentially does the same only in my
> set_error_handler call.
> [/qoute]
> 
> So you pass a value to it for the mask:
> (as defined here:
> http://nl3.php.net/manual/en/function.error-reporting.php)
> value         constant
> 1     E_ERROR
> 2     E_WARNING
> 4     E_PARSE
> 8     E_NOTICE
> 16    E_CORE_ERROR
> 32    E_CORE_WARNING
> 64    E_COMPILE_ERROR
> 128   E_COMPILE_WARNING
> 256   E_USER_ERROR
> 512   E_USER_WARNING
> 1024  E_USER_NOTICE
> 6143  E_ALL
> 2048  E_STRICT
> 4096  E_RECOVERABLE_ERROR
> 8192  E_DEPRECATED
> 16384         E_USER_DEPRECATED
> 
> So, for example,  if you want to catch E_WARNING and E_NOTICE: you look
> up their values, add them, and pass that value. In this case 2+8=12.
> 

Yes, and now, because I don't believe (or, don't hope that) this is the
whole masking business. I'm thinking that the masking thing is a
bit-shifting thing that makes it possible to say yes please to E_WARNING
(2) and E_NOTICE (8), but NOT to E_PARSE (4), and thus it's not 2+8=10, but
some kind of shifting, which would explain the "squared leaps" in error
numbers instead of just 1,2,3,4,..., and also the "error_reporting  = 
E_ALL & ~E_NOTICE" which is definitely not a simple addition of error level
values.

That is my whole entire question. How does the masking business work? If
it's not just adding numbers, which I'm pretty sure it isn't :)

Daniel

> But I have this feeling that I still don't understand what your problem
> is. ;-)
> 
> <snip>
> 
>>> Also, if you write your own handler, be sure you check for
>>> errorsupression.
>>>
>>> Here is the first peice of code of an errorhandler I use often:
>>>
>>> function errorHandler($number, $string, $file, $line, $context)  {
>>> // If the user uses errorsurperrsion with @, we need to forgive this
>>> error!
>>>   if (error_reporting() == 0){
>>>     // The error was surpressed, return without futher interference.
>>>     return;
>>>   }
>>> // rest of the errorhandler
>>>
>> 
>> I did not know of this. Very useful tip! I have previously turned
>> error_reporting on and off on-the-fly to achieve the same! Thank you very
>> much :)
>> 
> 
> Glad to hear that.
> I found the solution to this 'problem' the hard way: ADODB (my favorite
> database abstractionlayer) created errors in my application. When I
> removed my own errorhandling the error were gone.
> So I look at the line where the error originated, and they all had a @
> in them. So I reread the whole errorhandling thingy on php.net, and it
> actually says it quite clearly. But appearantly you missed it too.
> Methinks the editors should put that part in BOLD. ;-)
> 
> Regards,
> Erwin Moller
> 
> 

0
daniel138 (30)
11/10/2008 10:09:56 PM
On Mon, 10 Nov 2008 23:09:56 +0100, daniel@danielsmedegaardbuus.dk 
wrote:
> Erwin Moller wrote:
> 
> > Hi,
> > 
> > Sorry to be so thick, but I do not understand what your problem is then.
> 
> Hehe, no worries, I may very well be the one who is thick here (in addition
> to me putting on a few early Christmas pounds), because my whole problem is
> basically that I don't understand the whole masking business :)
> 
> > You can overrule the default errorhandler (with its associated default
> > error_reporting levels) with you own customn errorhandler (with it
> > associated error_reporting levels passed to the function.).
> > 
> > This is your core 'problem', right?:
> > [quote]
> > - on every error/notice/whatever comes by my custom error handler, to be
> >   able to specify a mask that essentially does the same only in my
> > set_error_handler call.
> > [/qoute]
> > 
> > So you pass a value to it for the mask:
> > (as defined here:
> > http://nl3.php.net/manual/en/function.error-reporting.php)
> > value         constant
> > 1     E_ERROR
> > 2     E_WARNING
> > 4     E_PARSE
> > 8     E_NOTICE
> > 16    E_CORE_ERROR
> > 32    E_CORE_WARNING
> > 64    E_COMPILE_ERROR
> > 128   E_COMPILE_WARNING
> > 256   E_USER_ERROR
> > 512   E_USER_WARNING
> > 1024  E_USER_NOTICE
> > 6143  E_ALL
> > 2048  E_STRICT
> > 4096  E_RECOVERABLE_ERROR
> > 8192  E_DEPRECATED
> > 16384         E_USER_DEPRECATED
> > 
> > So, for example,  if you want to catch E_WARNING and E_NOTICE: you look
> > up their values, add them, and pass that value. In this case 2+8=12.
> > 
> 
> Yes, and now, because I don't believe (or, don't hope that) this is the
> whole masking business. I'm thinking that the masking thing is a
> bit-shifting thing that makes it possible to say yes please to E_WARNING
> (2) and E_NOTICE (8), but NOT to E_PARSE (4), and thus it's not 2+8=10, but
> some kind of shifting, which would explain the "squared leaps" in error
> numbers instead of just 1,2,3,4,..., and also the "error_reporting  = 
> E_ALL & ~E_NOTICE" which is definitely not a simple addition of error level
> values.
> 
> That is my whole entire question. How does the masking business work? If
> it's not just adding numbers, which I'm pretty sure it isn't :)

Right, the basic way to approach this is having each option assigned 
a value of 2^n, which gives us binary numbers like:

00000001 OPTION_ONE
00000010 OPTION_TWO
00000100 OPTION_THREE
00001000 OPTION_FOUR
00010000 OPTION_FIVE
00100000 OPTION_SIX
01000000 OPTION_SEVEN
10000000 OPTION_EIGHT

You can increase the bit length as necessary. I chose to align each 
of the values as a byte.

Using bit-wise operators is natural here for PHP.  Depending on which 
bits are "on", that will determine which error levels are being 
employed.  We use the bitwise operators to determine the combination 
of 1's and 0's we want.  The constants (E_*) are convenient, because 
they provide context, and allow the confusing-looking values to 
remain internalized, and possibly changed without affecting us.  This 
is why I would not recommend directly dealing with the values 
themselves.

// Turning on multiple options via OR'ing bits together
$bitstring = E_ALL | E_STRICT;

Here's how you look at it in binary (aligning both to word length). 
OR'ing results in a 1 if either bit is 1, 0 otherwise.  Note that 
E_ALL is essentially a shortcut for turning on several options, which 
PHP has provided for us.  Notice how the bit where E_STRICT is set is 
0 in E_ALL.  This shows why we need to OR E_STRICT explicitly.

   0001 0111 1111 1111 (E_ALL = 6143 base 10)
OR
   0000 1000 0000 0000 (E_STRICT = 2048 base 10)
   -------------------
   0001 1111 1111 1111 (E_ALL | E_STRICT = 8191 base 10)

I suggest you search for a tutorial on bitwise operations on the Web.  
This concept is used fairly often in many languages.

[snip]

-- 
Curtis
$email = str_replace('sig.invalid', 'gmail.com', $from);
0
dyer851 (264)
11/11/2008 1:46:57 AM
Curtis wrote:

> On Mon, 10 Nov 2008 23:09:56 +0100, daniel@danielsmedegaardbuus.dk
> wrote:
>> Erwin Moller wrote:
>> 
>> > Hi,
>> > 
>> > Sorry to be so thick, but I do not understand what your problem is
>> > then.
>> 
>> Hehe, no worries, I may very well be the one who is thick here (in
>> addition to me putting on a few early Christmas pounds), because my whole
>> problem is basically that I don't understand the whole masking business
>> :)
>> 
>> > You can overrule the default errorhandler (with its associated default
>> > error_reporting levels) with you own customn errorhandler (with it
>> > associated error_reporting levels passed to the function.).
>> > 
>> > This is your core 'problem', right?:
>> > [quote]
>> > - on every error/notice/whatever comes by my custom error handler, to
>> > be
>> >   able to specify a mask that essentially does the same only in my
>> > set_error_handler call.
>> > [/qoute]
>> > 
>> > So you pass a value to it for the mask:
>> > (as defined here:
>> > http://nl3.php.net/manual/en/function.error-reporting.php)
>> > value         constant
>> > 1     E_ERROR
>> > 2     E_WARNING
>> > 4     E_PARSE
>> > 8     E_NOTICE
>> > 16    E_CORE_ERROR
>> > 32    E_CORE_WARNING
>> > 64    E_COMPILE_ERROR
>> > 128   E_COMPILE_WARNING
>> > 256   E_USER_ERROR
>> > 512   E_USER_WARNING
>> > 1024  E_USER_NOTICE
>> > 6143  E_ALL
>> > 2048  E_STRICT
>> > 4096  E_RECOVERABLE_ERROR
>> > 8192  E_DEPRECATED
>> > 16384         E_USER_DEPRECATED
>> > 
>> > So, for example,  if you want to catch E_WARNING and E_NOTICE: you look
>> > up their values, add them, and pass that value. In this case 2+8=12.
>> > 
>> 
>> Yes, and now, because I don't believe (or, don't hope that) this is the
>> whole masking business. I'm thinking that the masking thing is a
>> bit-shifting thing that makes it possible to say yes please to E_WARNING
>> (2) and E_NOTICE (8), but NOT to E_PARSE (4), and thus it's not 2+8=10,
>> but some kind of shifting, which would explain the "squared leaps" in
>> error
>> numbers instead of just 1,2,3,4,..., and also the "error_reporting  =
>> E_ALL & ~E_NOTICE" which is definitely not a simple addition of error
>> level values.
>> 
>> That is my whole entire question. How does the masking business work? If
>> it's not just adding numbers, which I'm pretty sure it isn't :)
> 
> Right, the basic way to approach this is having each option assigned
> a value of 2^n, which gives us binary numbers like:
> 
> 00000001 OPTION_ONE
> 00000010 OPTION_TWO
> 00000100 OPTION_THREE
> 00001000 OPTION_FOUR
> 00010000 OPTION_FIVE
> 00100000 OPTION_SIX
> 01000000 OPTION_SEVEN
> 10000000 OPTION_EIGHT
> 
> You can increase the bit length as necessary. I chose to align each
> of the values as a byte.
> 
> Using bit-wise operators is natural here for PHP.  Depending on which
> bits are "on", that will determine which error levels are being
> employed.  We use the bitwise operators to determine the combination
> of 1's and 0's we want.  The constants (E_*) are convenient, because
> they provide context, and allow the confusing-looking values to
> remain internalized, and possibly changed without affecting us.  This
> is why I would not recommend directly dealing with the values
> themselves.
> 
> // Turning on multiple options via OR'ing bits together
> $bitstring = E_ALL | E_STRICT;
> 
> Here's how you look at it in binary (aligning both to word length).
> OR'ing results in a 1 if either bit is 1, 0 otherwise.  Note that
> E_ALL is essentially a shortcut for turning on several options, which
> PHP has provided for us.  Notice how the bit where E_STRICT is set is
> 0 in E_ALL.  This shows why we need to OR E_STRICT explicitly.
> 
>    0001 0111 1111 1111 (E_ALL = 6143 base 10)
> OR
>    0000 1000 0000 0000 (E_STRICT = 2048 base 10)
>    -------------------
>    0001 1111 1111 1111 (E_ALL | E_STRICT = 8191 base 10)
> 
> I suggest you search for a tutorial on bitwise operations on the Web.
> This concept is used fairly often in many languages.
> 
> [snip]
> 

Ah, this was exactly what I was hoping for :) And easy to understand, too!
Thank you so much! :)

May I ask what the AND operator does? And the ~ in front of a constant, is
that only for the php.ini setting, or is that also valid in php, and if so,
what does it mean?

Thank you very much, Curtis, for the explanation :)

Daniel
0
daniel138 (30)
11/11/2008 7:45:36 AM
On Tue, 11 Nov 2008 08:45:36 +0100, Daniel Smedegaard Buus
<daniel@danielsmedegaardbuus.dk> wrote in
<4919381d$0$90271$14726298@news.sunsite.dk>:

[snip explanation of bit fields]

>May I ask what the AND operator does?

Assuming that you mean the "&" operator, it keeps only the bits that
are set in both variables.  E.g. 2 & 3 = 2 

00000010  // 2 base 2
00000011  // 3 base 2
--------
00000010  // keeps only the bit in the two's place 
          // because it's the only one set in both


>And the ~ in front of a constant, is that only for the php.ini
>setting, or is that also valid in php, and if so, what does it mean?

It's the complement operator, which inverts the bits.  E.g. if 2 is
00000010 then it's complement is 11111101.  It's useful for removing a
bit from a bitfield.  Saying E_ALL & ~ E_NOTICE is a way of saying
"everything except for notices".
-- 
Charles Calvert             |  Web-site Design/Development
Celtic Wolf, Inc.           |  Software Design/Development
http://www.celticwolf.com/  |  Data Conversion
(703) 580-0210              |  Project Management
0
cbciv (106)
11/11/2008 10:13:02 PM
On Tue, 11 Nov 2008 08:45:36 +0100, daniel@danielsmedegaardbuus.dk 
wrote:
> Curtis wrote:
> 
> > On Mon, 10 Nov 2008 23:09:56 +0100, daniel@danielsmedegaardbuus.dk
> > wrote:
> >> Erwin Moller wrote:
> >> 
> >> > Hi,
> >> > 
> >> > Sorry to be so thick, but I do not understand what your problem is
> >> > then.
> >> 
> >> Hehe, no worries, I may very well be the one who is thick here (in
> >> addition to me putting on a few early Christmas pounds), because my whole
> >> problem is basically that I don't understand the whole masking business
> >> :)
> >> 
> >> > You can overrule the default errorhandler (with its associated default
> >> > error_reporting levels) with you own customn errorhandler (with it
> >> > associated error_reporting levels passed to the function.).
> >> > 
> >> > This is your core 'problem', right?:
> >> > [quote]
> >> > - on every error/notice/whatever comes by my custom error handler, to
> >> > be
> >> >   able to specify a mask that essentially does the same only in my
> >> > set_error_handler call.
> >> > [/qoute]
> >> > 
> >> > So you pass a value to it for the mask:
> >> > (as defined here:
> >> > http://nl3.php.net/manual/en/function.error-reporting.php)
> >> > value         constant
> >> > 1     E_ERROR
> >> > 2     E_WARNING
> >> > 4     E_PARSE
> >> > 8     E_NOTICE
> >> > 16    E_CORE_ERROR
> >> > 32    E_CORE_WARNING
> >> > 64    E_COMPILE_ERROR
> >> > 128   E_COMPILE_WARNING
> >> > 256   E_USER_ERROR
> >> > 512   E_USER_WARNING
> >> > 1024  E_USER_NOTICE
> >> > 6143  E_ALL
> >> > 2048  E_STRICT
> >> > 4096  E_RECOVERABLE_ERROR
> >> > 8192  E_DEPRECATED
> >> > 16384         E_USER_DEPRECATED
> >> > 
> >> > So, for example,  if you want to catch E_WARNING and E_NOTICE: you look
> >> > up their values, add them, and pass that value. In this case 2+8=12.
> >> > 
> >> 
> >> Yes, and now, because I don't believe (or, don't hope that) this is the
> >> whole masking business. I'm thinking that the masking thing is a
> >> bit-shifting thing that makes it possible to say yes please to E_WARNING
> >> (2) and E_NOTICE (8), but NOT to E_PARSE (4), and thus it's not 2+8=10,
> >> but some kind of shifting, which would explain the "squared leaps" in
> >> error
> >> numbers instead of just 1,2,3,4,..., and also the "error_reporting  =
> >> E_ALL & ~E_NOTICE" which is definitely not a simple addition of error
> >> level values.
> >> 
> >> That is my whole entire question. How does the masking business work? If
> >> it's not just adding numbers, which I'm pretty sure it isn't :)

[explanation snipped]

> Ah, this was exactly what I was hoping for :) And easy to understand, too!
> Thank you so much! :)
> 
> May I ask what the AND operator does? And the ~ in front of a constant, is
> that only for the php.ini setting, or is that also valid in php, and if so,
> what does it mean?
> 
> Thank you very much, Curtis, for the explanation :)
> 
> Daniel

I'm glad the explanation helped. :)

I'll leave you to read Charles Calvert's response on the bitwise & 
and ~ (1's complement) operator.
-- 
Curtis
$email = str_replace('sig.invalid', 'gmail.com', $from);
0
dyer851 (264)
11/12/2008 1:37:03 AM
Charles Calvert wrote:

> On Tue, 11 Nov 2008 08:45:36 +0100, Daniel Smedegaard Buus
> <daniel@danielsmedegaardbuus.dk> wrote in
> <4919381d$0$90271$14726298@news.sunsite.dk>:
> 
> [snip explanation of bit fields]
> 
>>May I ask what the AND operator does?
> 
> Assuming that you mean the "&" operator, it keeps only the bits that
> are set in both variables.  E.g. 2 & 3 = 2
> 
> 00000010  // 2 base 2
> 00000011  // 3 base 2
> --------
> 00000010  // keeps only the bit in the two's place
>           // because it's the only one set in both
> 
> 
>>And the ~ in front of a constant, is that only for the php.ini
>>setting, or is that also valid in php, and if so, what does it mean?
> 
> It's the complement operator, which inverts the bits.  E.g. if 2 is
> 00000010 then it's complement is 11111101.  It's useful for removing a
> bit from a bitfield.  Saying E_ALL & ~ E_NOTICE is a way of saying
> "everything except for notices".

Yes, thank you both :) I did the obligatory Googling, and ended up with an
extremely explanatory C tutorial on bitwise operations, and luckily, this
applies 1:1 on PHP :)

Funny, from the outside it seems like a bad thing to be happy that you just
made handling of errors in your code faster ;) He he. Well, we gotta be
realistic beings, right? ;)

Another funny thing is that reading this, everything just fell into place.
I've been taught this as part of my education, specifically when learning
assembly language, but for some reason it just doesn't stick with me... I
really like languages like Ruby :D

Either way, It's great to revisit basic stuff like this, because it really
adds a lot of understanding to knowing what you're actually doing when you
declare a class or use something basic like control structures. It's really
healthy to learn this, you know :)

Cheers to you both,
Daniel :)
0
daniel138 (30)
11/12/2008 8:10:33 PM
Reply:

Similar Artilces:

When is an error not an error?
When it's OSS slopware, of course. http://www.angelfire.com/planet/dfs0/Knode_send_error.png On 2006-09-12 02:42, * DFS wrote: > When it's OSS slopware, of course. > > http://www.angelfire.com/planet/dfs0/Knode_send_error.png > Well, some time ago I had a problem with OE - too long reference line to other posts, and OE of course refused to send... then crashed. Should I name it a feature? -- Andrea On Tue, 12 Sep 2006 03:25:29 +0200, Andrea wrote: > On 2006-09-12 02:42, * DFS wrote: >> When it's OSS slopware, of course. >> >> http:/...

When is an error not an error?
The Java language specification claims in: 8.8.7.1 Explicit Constructor Invocations .... "If an anonymous class instance creation expression appears within an explicit constructor invocation statement, then the anonymous class may not refer to any of the enclosing instances of the class whose constructor is being invoked." Helpfully it gives an example: "For example: class Top { int x; class Dummy { Dummy(Object o) {} } class Inside extends Dummy { Inside() { super(new Object() { int r = x; }); // error } Inside(final int y) { super(new Object() { int r = y; }); // correct } } } " Notice the word 'error' in the comment. This example compiles without error and produces the correct code. In what sense is it an 'error'? It is not a compiler error, it is not a runtime error. To quote Douglas Adams "this must be some new meaning of the word 'error' with which I am unfamiliar". Any idea what's gone wrong? In article <gepkhr$rop$1$8302bc10@news.demon.co.uk>, Anon <blackhole@nowhere.com> wrote: > The Java language specification claims in: > 8.8.7.1 Explicit Constructor Invocations [<http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.8. 7.1>] > Notice the word 'error' in the comment. This example compiles without > error and ...

(assert-error) tests errors and error messages
I wrote (assert-error) to make sure that a function generates an error, and verify the error message. What do you think? Below is the definition and a few test cases, for Emacs 22.1.50. (require 'cl) (defmacro assert-error (form &optional regexp) "FORM must signal an error. Signal an error otherwise. Additionally, the error message must match REGEXP. Case is ignored while matching REGEXP." (let ((msg (make-symbol "msg")) (ok (make-symbol "ok")) (res (make-symbol "res"))) `(let ((,ok nil)) (condition-case err ;; Evaluate FORM and save the result. (set ',res ,form) (error ;; This runs when FORM signals an error of any kind. (set ',ok t) (set ',msg (error-message-string err)))) (unless ,ok (error "Did not signal an error: %s (returned %s)" ',form ,res)) (when ,regexp ;; Here we know that FORM signaled an error, and that the ;; caller wants to check the error message. (unless (let ((case-fold-search t)) (string-match ,regexp ,msg)) (error "Error message does not match \"%s\": \"%s\"" ,regexp ,msg)))))) ;; Test assert-error, mostly by running it against itself. (assert-error (assert-error nil) "did not signal.*nil") (assert-error (assert-error t) "\\bt\\b") (as...

Error directing BCP In errors to error file
Greetings, I am trying to bcp in data to a table which is in different server . Though the bcp in works fine but the error file is not being created and rejected records are not being directyd to the error file. Query looks like: bcp <db>..test_b_plan_cp in /home/file_out.txt -c -t '|' -S *****-U ****** -P ******-I /home/bcp2db_sql.ini -e /home/bcp2db.error. Can someone please help? TIA. Regards, Rajpreet ...

Testing Error Handling for Unusual Database Errors
Have you ever had a piece of database code in which you wanted to test every probable and improbable error condition that might occur? For example, suppose you had this code and wanted to make sure that the error handling did the right thing when an InstantiationException occurred: ---------------------------------------------------------------------------------------------------------------- /* Load the JDBC driver. */ try { Class.forName(this.jdbcDriverName).newInstance(); } catch (ClassNotFoundException cnf_excp) { String msg = "Failed to load JDBC driver " + this.jdbcDriverName + "."; this.logger.logp(Level.SEVERE, this.CLASS_NAME, METHOD_NAME, msg, cnf_excp); System.exit(16); } catch (InstantiationException i_excp) { String msg = "Failed to load JDBC driver " + this.jdbcDriverName + "."; this.logger.logp(Level.SEVERE, this.CLASS_NAME, METHOD_NAME, msg, i_excp); System.exit(16); } catch (IllegalAccessException ia_excp) { String msg = "Failed to load JDBC driver " + this.jdbcDriverName + "."; this.logger.logp(Level.SEVERE, this.CLASS_NAME, METHOD_NAME, msg, ia_excp); System.exit(16); } ---------------------------------------------------------------------------------------------------------------- Well, ...

Are ActiveX Errors Handled Like VB Errors?
I have a program that goes out to a web site and works fine as long as all the objects are there. When an object is not there, I get: Runtime error '429': ActiveX Component Can't Create Object Why doesn't this code trap the error? Private Sub GetBills() On Error GoTo ExecuteError blah, blah Exit Sub ExecuteError: txtNotes.Text = txtNotes.Text & vbCrLf & _ "Error executing command in cmdSelectClient_Click" & _ vbCrLf & Err.Description End Sub The only thing I...

Apache2Triad PHP Errors without Error Messages
How do I get Apache2Triad to print the reason it stops while executing my PHP programs? ...

Error 8 Compilation Error. File permission error or DMA hardware error detected
I just upgraded my Labview code to Labview 8.5 from LV8.2.1 Then I tried to compile&nbsp;my code to get an .exe file I keep getting the following error, &nbsp; Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference: Error 8 occurred at Write to Text File in AB_Engine_Update_INI_Header.vi-&gt;AB_Application.lvclass:Create_INI_File.vi-&gt;AB_Application.lvclass:Copy_Files.vi-&gt;AB_Build.lvclass:Build.vi-&gt;AB_EXE.lvclass:Build.vi-&gt;AB_Build.lvclass:Build_from_Wizard.vi-&gt;AB_UI_FRAMEWORK.vi-&gt;AB_Item_OnDoProperties.vi-&gt;AB_Item_OnDoProperties.vi.ProxyCaller Possible reason(s): LabVIEW:&nbsp; File permission error. You do not have the correct permissions for the file.=========================NI-488:&nbsp; DMA hardware error detected. C:\UserData\LabView\IFX Interop Test exe\GMXiTest.ini &nbsp; I never have this problem if I compile using LV8.2.1. Please help! Thanks. &nbsp; hi there just to be sure: has 8.5 been installed under an other account than yours? make sure you have the windows access rigths to the LabVIEW - folder. Hi, Yes I have administrator rights on the PC. It was installed with full R/W permission. I saw in the forum that others are having the same problem and tried this work-around mentioned but it did not work. <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=172537&amp;query...

error: error sending
Hi, I hope somebody can help me. For sending mail I configured alpine with the following line: smtp.web.de/tls/user=xxxxxxx@web.de . But every time I tried the message "error sending" occured. To figure out more details I added the parameter debug, but there was no file .pine-debug. After reading the manual I tried: alpine -d 5 and got the message: Argument Error: unknown flag "d", debugging not compiled in Before downloading the source and compile it by my self, I thought I should ask you guys for help. My pine version: alpine-2.00-5.fc11.i586 Best regards Chris...

SQL Errors: Where is the error?
I have just finished -- I hope I have finished -- some changes to one program of mine that has some hairy SQL. One of the SQL statments is 40 lines long. Granted it could be shorter vertically, but it is still 852 characters long. Occasionally -- read "All too often" -- while wrestling with this program, there would be an error in my SQL syntax. VFP is not terribly helpful with such error messages as Syntax error. Command is missing required clause. These are not terribly useful. Sometimes, I have hunted for minutes before realising that...

error with ERROR function
Hi all, I'm getting an error when I use the "error" function. Here is the error message: ---------------------------------------- ??? Index exceeds matrix dimensions. Error in ==> C:\MATLAB6p5p1\mese\user_functions\ssave.m On line 765 ==> error('ERROR e43: Initial Operating Point file cannot be found'); ---------------------------------------- What matrix is it refering to? thanks, SK "Saif K" <buckeyeforever2001@yahoo.com> wrote in message news:eee53de.-1@webx.raydaftYaTP... > Hi all, > > I'm getting an error when I use the "error" function. > > Here is the error message: > > ---------------------------------------- > ??? Index exceeds matrix dimensions. > > Error in ==> C:\MATLAB6p5p1\mese\user_functions\ssave.m > On line 765 ==> error('ERROR e43: Initial Operating > Point file cannot be found'); > ---------------------------------------- > > What matrix is it refering to? Set a breakpoint on line 765 of ssave (click on the line next to the line number in the MATLAB Editor.) When MATLAB pauses execution on that line and shows the debug prompt (K>>) check your workspace. You likely have a matrix named error that is being used instead of the error function and that matrix has fewer than 117 elements (the ASCII code for 'u', the last character in your string in ASCII code order). -- Steve Lord slord@mathworks.com ...

@@Error not catching error.
Hi all, I want to catch error in stored procedure and return error message. I want to catch error 'Syntax error converting the varchar value 'a' to a column of data type int.' Means error occuring if i enter wrong value. Say suppose i have statment like select * from emp where rowid = 'a' PRINT @@ERROR print 'reach' here rowid is integer value so i am getting above mention error. So what i am expecting is it should print error and then print 'reach' which is not happening. can anyone tell me reason behind this and how to overcome this problem. thanks in advance. (trialproduct2004@yahoo.com) writes: > I want to catch error in stored procedure and return error message. > I want to catch error 'Syntax error converting the varchar value 'a' > to a column of data type int.' Means error occuring if i enter wrong > value. > > Say suppose i have statment like > > select * from emp where rowid = 'a' > PRINT @@ERROR > print 'reach' > > here rowid is integer value so i am getting above mention error. > > So what i am expecting is it should print error and then print 'reach' > which is not happening. > can anyone tell me reason behind this and how to overcome this > problem. If you are on SQL 2005, you need to use TRY-CATCH. If you are using SQL 2000, you first need to upgrade to SQL 2005. In SQL 2000 you cannot detect this error, because the e...

php error handling with apache
hi. php has error handling and that's great. but it can't handle serious errors like E_PARSE. set_error_handler nor register_shutdown_function can't handle this. is there any other way to do this with php? or maybe that may be done somehow with apache? thank you. sorry, if this should be in apache conf... Rytis wrote: > hi. php has error handling and that's great. but it can't handle > serious errors like E_PARSE. set_error_handler nor > register_shutdown_function can't handle this. is there any other way > to do this with php? or maybe that may be done somehow with apache? > thank you. sorry, if this should be in apache conf... > AFAIK, syntax errors are fatal in any language, and there's no way to handle those errors. It's why you need a development system - to get the bugs out before making it public. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== Jerry Stuckle wrote: > AFAIK, syntax errors are fatal in any language, and there's no way to > handle those errors. Hmm, not really. See HTML: HTML parsers can recover gracefully from badly terminated code. It really depends on the compiler (or interpreter). However, developing a grammar which can recover from errors is more difficult than one which can't. That said, if you're getting E_PARSE fatal errors, there is no way around it. Fix you...

error C2197 error
Hello I am getting this error: error C2197: 'long (__stdcall *)(void)' : too many actual parameters Error executing cl.exe. The offending line is: if ((lResult = (*pfnGetProviderList)(0x00020000, pProviderList)) != 0) // this one { goto ProviderInstall_freeProviderList; } I am converting this C code into C++. Is the problem that compiler does not understand the parameters required for pfnGetProviderList? How can I fix? Angus wrote: > Hello > > I am getting this error: > > error C2197: 'long (__stdcall *)(void)' : too many actual parameters > Error executing cl.exe. > > The offending line is: > > if ((lResult = (*pfnGetProviderList)(0x00020000, > pProviderList)) != 0) // this one > { > goto ProviderInstall_freeProviderList; > } > > I am converting this C code into C++. Is the problem that compiler > does not understand the parameters required for pfnGetProviderList? > How can I fix? Specific implementations and their diagnostics are off-topic for this group, but see the following link: <http://support.microsoft.com/kb/117428> Angus wrote, On 14/02/07 17:41: > Hello > > I am getting this error: > > error C2197: 'long (__stdcall *)(void)' : too many actual parameters > Error executing cl.exe. This error message says the function does not take any parameters. > The offending line is: >...

Error upon Error...
anyone seen this error before: > Can't load '/usr/local/lib/perl5/5.8.0/PA-RISC2.0/auto/DB_File/DB_File.sl' for module DB_File: No such file or directory at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/XSLoader.pm line 83. > at /usr/local/lib/perl5/5.8.0/PA-RISC2.0/DB_File.pm line 236 I'm just trying to run this script: #!/usr/bin/perl -w use strict; use DB_File; print "Hello World!\n" all three of the files exist on the system....why is it saying this. (there are a few scripts that I have that want to use DB_File and they all say this.... that's why I j...

error in, error out clusters.
Dear all, &nbsp; I am new user for Labview software. I try to create a Visa Configuration Serial Port but, the error occurred, message&nbsp;as: &nbsp; "You have two or more cluster data types wired together, but the clusters have different kinds or numbers of elements.Cluster Cluster 2, a cluster of 1 element, conflicts with cluster error in (no error), a cluster of 3 elements." &nbsp; My cluster include the function of: 1) boolean Properties 2) Numeric Properties 3) String Properties &nbsp; Q:&nbsp;how to create these 3 function in&nbsp;cluster? ...

Error Handling in VB6
I've only been coding in VB for about 5 months, plese excuse this if it's elementary. I'm creating a program in VB6 which will go through the list of customer accounts in our SQL-2000 database and do some cleanup. For a few hundred of our subcontracted accounts, the USPS ZipFour database for that block of zip codes and street segments hasn't been imported to our database, these accounts cause errors in my program and need to be skipped. I've created an Error handler which is supposed to jump to the end of the loop for my ADODB recordset. It works fine the first...

Error Number 3000: Reserved Error (-3002); there is no message for this error
Help... I've been moving code about to tidy it up and this error is occuring. I have tracked it down to a set querydef command, i have properly specified a database and am using correct syntax for the set command but this error is popping up. Any ideas why? Please help....... Rob. Try to decompile the database (command-line switch /decompile) dkintheuk wrote: > Help... > > I've been moving code about to tidy it up and this error is occuring. > > I have tracked it down to a set querydef command, i have properly > specified a database and am using correct syntax for the set command > but this error is popping up. > > Any ideas why? > > Please help....... > > Rob. > -- Bas Cost Budde, Holland http://www.heuveltop.nl/BasCB/msac_index.html Er... gonna sound dumb now but how do I do that? Thanks. Ok... found out how... easy really. Unfortunately, there is no change in the behaviour of the code. Argh! Still could use some help here... I've now decomplied... Then i exported all code... Then i compacted and repaired the db Then i reimported all the code Then i compacted and repaired again It still doesn't want to work! Ok... here it is - i was being thick (no surprise there). I had a problem in my SQL in that the SQL was designed to do a TRANSFORM to create a nice crosstab query. I later added an INTO command to the SQL to get the output into a temp table. This is not allowed for TRANSFORM queri...

Error: An error occurred while shelling out to mbuild (error code = 1).
Hi! I'm trying to create an exe file from my GUI, so that the GUI can be run on computers not having MATLAB. I'm using MATLAB 7.9.0(R2009b) and the Compiler version is 4.11(R2009b). I receive the following error message when using deploytool: mkdir 'C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy\distrib' Warning: Directory already exists. mkdir 'C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy\src' Warning: Directory already exists. mcc -F C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy.prj mcc -o 'test_deploy' -W 'WinMain:test_deploy' -d 'C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy\src' -T 'link:exe' -v 'C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy.m' Compiler version: 4.11 (R2009b) Processing include files... 2 item(s) added. Processing directories installed with MCR... The file C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy\src\mccExcludedFiles.log contains a list of functions excluded from the CTF archive. 2 item(s) added. Generating MATLAB path for the compiled application... Created 40 path items. Begin validation of MEX files: Wed Sep 08 17:59:41 2010 End validation of MEX files: Wed Sep 08 17:59:41 2010 Parsing file "C:\Documents and Settings\Paulo\Meus documentos\MATLAB\test_deploy.m" (Referenced from: "Compiler Command Line"). Pars...

Date in Apache2's error log when error caused by PHP
I've noticed since moving from Apache1/mod_php4/linux to Apache2/mod_php5/linux that when an error is produced by PHP and put in the error_log, the date is no longer logged as well: Apache1/php4/linux example in Apache error_log: [Thu Jan 8 15:06:52 2004] [error] PHP Warning: opendir(/foo/bar/): failed to open dir: No such file or directory in /blah/something/listing.html on line 84 Apache2/php5/linux example in Apache error_log: [client 1.2.3.4] PHP Notice: Undefined variable: browserline in /foo/bar/zing.html on line 18 Is there any way to restore this, either at PHP or Ap...

"Error: Windows API error 6: The handle is invalid"
I am using Windows XP v5.1 (Service Pack 1) on a GenuineIntel motherboard with a 500 MHx Pentium III processor. I try to install the basic version of MikTex 2.5 and get this error "Error: Windows API error 6: The handle is invalid" at the end of the installation. Can anyone suggest a fix? I am not committed to MikTeX, only to getting LaTeX working on my machine. Many thanks in advance, Peter. MajorSetback@excite.com wrote: > I am using Windows XP v5.1 (Service Pack 1) on a GenuineIntel > motherboard with a 500 MHx Pentium III processor. I try to install the > basic version of MikTex 2.5 and get this error > "Error: Windows API error 6: The handle is invalid" > at the end of the installation. Can anyone suggest a fix? I am not > committed to MikTeX, only to getting LaTeX working on my machine. > > Many thanks in advance, > Peter. I ran the installation again and it worked the second time. MajorSetback@excite.com writes: > MajorSetback@excite.com wrote: >> I am using Windows XP v5.1 (Service Pack 1) on a GenuineIntel >> motherboard with a 500 MHx Pentium III processor. I try to install the >> basic version of MikTex 2.5 and get this error >> "Error: Windows API error 6: The handle is invalid" >> at the end of the installation. Can anyone suggest a fix? I am not >> committed to MikTeX, only to getting LaTeX working on my machine. >> >> Many thanks in advan...

How to change 'On Error Goto ArreurA' with 'On Error Goto ArreurB' without error if an error occured?
Exemple: On Error Goto ErreurA Picture = LoadPicture(VarName1) On Error Goto ErreurB Picture = LoadPicture(VarName2) exit sub ErreurA: msgbox "ErreurA= VarName1" exit sub ErreurB: msgbox "ErreurB= VarName2" Exit sub If an error occudes with Picture = LoadPicture(VarName2) it cause an error and the program stop there without error message. What code line must I add? Raymond H. "Raymond H." <divers_rh@hotmail.com> wrote in message news:TuHRc.6180$a65.235836@news20.bellglobal.com... > Exemple: > > On Error Goto ErreurA > Picture = LoadPicture(VarName1) > On Error Goto ErreurB > Picture = LoadPicture(VarName2) > exit sub > ErreurA: > msgbox "ErreurA= VarName1" > exit sub > ErreurB: > msgbox "ErreurB= VarName2" > Exit sub > > If an error occudes with > Picture = LoadPicture(VarName2) > it cause an error and the program stop there without error message. What > code line must I add? In the IDE, go to Tools->Options->General Tab. Select 'Break on Unhandled Errors'. Hello, this error occure even with the exe. I think it miss a code line in my projet but I don't know wich one. r.h. "Peter Young" <youngpa@comcast.no.net.spam.please> a �crit dans le message de news:eBMRc.229775$%_6.160126@attbi_s01... > > "Raymond H." <divers_rh...

Error i can't understand! !--error 4 undefined variable : %c_1_s
!--error 4 undefined variable : %c_1_s : this is the error message i get when executing the following code : //////////////////////////////////////// FE = read('Fe.txt',278,3); [ok,XValue] = getvalue("Input of X-ray energy",'X-Ray energy (eV) (1000-24900)',list("str",1),["17480"]); a = 1; while XValue < FE(a,1) == %f a = a + 1; end; ////////////////////////////////////// Note that if i ask the value of XValue it returns the right answer( the value I enter via the box) where as if i execute this it works : ///////////////////////////////////// FE = read('Fe.txt',278,3); Xwl = 16400 a = 1; while Xwl < FE(a,1) == %f a = a + 1; end ///////////////////////////////// I think it has to do with the XValue variable but there is a correct value in it so it should work! If someone can help! thx leo wrote: > !--error 4 undefined variable : %c_1_s : See help overloading See also http://scilabsoft.inria.fr/cgi-bin/bugzilla_request_II/show_bug.cgi?id=289 Francois Hmm, second thoughts. leo wrote: > while XValue < FE(a,1) == %f What are you trying to achieve with this? I believe that you rather want while XValue >= FE(a,1) or while ~(XValue < FE(a,1) ) Francois In fact the getvalue function you use return XValue as a string due to the list('str',1) argument In the while the XValue < FE(a,1) comparison is be...

handling PL/SQL compile errors, 'show errors' as procedure
Q: Which table and timestamp column is used for 'show errors' definition of 'the previously defined object'? Longer description: Concider you have the schema definition for a larger schema with tables and PL/SQL objects in a text file. Everything works for the current version but you want some error control for new pices of code. So, you want SQLPLUS to abort when the first defective object definition is found and report an exist status unequal to zero in case of problems. I tried to catch compilation errors with WHENEVER SQLERROR EXIT FAILURE and noticed sqlplus exits for errors in SQL code, but errors in PL/SQL code will pass unnoticed. Sqlplus will report the errors for the last compiled object from USER_ERRORS with 'show errors', but it will not abort the script. WHENEVER SQLERROR does not catch this type of errors. Google found an article from T.Kyte with a PLS/SQL procedure which addresses this problem. The procedure raises an exception if it finds an error message in USER_ERRORS. But the original procedure required me to enter and update the object name as a parameter of the procedure for each use of the procedure. Would't it be nice to let the method it self find the 'most recently compiled object' and raise only if that object had an error? I tried to modify the procedure, but failed to find the proper timestamp column. Do you know how which view and column finds the 'most recently compiled object'? Thank...

Web resources about - Understanding error masking in error handling... - comp.lang.php

Trump, Cruz trade barbs over wives in presidential race
By Amy Tennery NEW YORK (Reuters) - Republican presidential candidates Donald Trump and Ted Cruz turned to Twitter to defend their wives' honor ...

Samsung Galaxy S7 Overtakes The iPhone As Consumer Reports’ Best Smartphone
Samsung and Apple are undeniably the two largest smartphone manufacturers on the planet right now and for a good few years they’ve been competing ...

Apple worries that spy technology has been secretly added to the computer servers it buys
Apple's huge success with services like iTunes, the App Store, and iCloud has a dark side. Apple hasn't been able to build the all the data ...

Google may release an iPhone keyboard with built-in search and GIFs
Google may be working on a software keyboard for the iPhone, with web search as a featured attraction. Unnamed sources told The Verge that Google ...

Yahoo follows DraftKings and Fan Duel in suspending fantasy sports in New York
Yahoo was due to suspend paid fantasy sports contests in New York state on Wednesday, a decision that follows similar moves on Monday by DraftKings ...

Barclays isn't planning to support Android Pay in the UK
If UK bank Barclays hadn't angered mobile customers enough over its delayed rollout of Apple Pay, a new announcement today looks take things ...

Hulk Hogan Exclusive: They 'Picked the Wrong Guy,' Former Wrestler Says of Gawker Victory
Fast Company Hulk Hogan Exclusive: They 'Picked the Wrong Guy,' Former Wrestler Says of Gawker Victory ABC News Wrestling legend Hulk Hogan ...

With Wii U’s fate in question, Nintendo’s NX might be its last chance
After spending three-and-a-half years languishing at the bottom of the market, the Wii U is finally being put to rest. That's according to a ...

Lupita Nyong'o’s 'Star Wars' character may have been CGI, but people don't realize just how much work ...
Taking a cue from the original "Star Wars" trilogy, "The Force Awakens" relied mostly on practical effects — except for Lupita Nyong'o's character, ...

AT&T launches international Wi-Fi Calling
If you’re traveling abroad and are tired of using Skype, WhatsApp, or Viber to call friends and family back in the US, you now have another option. ...

Resources last updated: 3/23/2016 5:33:10 PM