Wierd Quantum Error

A

andyblum

Working with a thrid party control (Sybase DataWindow.Net). It is a
great component but I found something really wierd and need help. The
object has a field inside of it called PrimaryBuffer. This field is
null when it shouldn't be (I wont go into the details). However, when
I inspect the object inside the debugger and scroll to the Primary Data
Field it then is instantiated. Again, the act of observing the field
inside of the debugger causes its instantiation. How can I mimic this
through code so I can find a work around. I cant just instantiate it
normally because its base data type is a custom object with no
constructor. The tool is supposed to be a able to have this
instantiated and it isnt. Until I scroll through its fields in the
debugger.

I called it a quantum error because in Physics the Uncertainty
principal states that the act of observation can change its results.


Any suggestions on how I can mimic what the debugger is doing when I
scroll through the fields so I can find a work around for my code that
is blowing up.

Andy
 
M

Michael C

Working with a thrid party control (Sybase DataWindow.Net). It is a
great component but I found something really wierd and need help. The
object has a field inside of it called PrimaryBuffer. This field is
null when it shouldn't be (I wont go into the details). However, when
I inspect the object inside the debugger and scroll to the Primary Data
Field it then is instantiated. Again, the act of observing the field
inside of the debugger causes its instantiation. How can I mimic this
through code so I can find a work around. I cant just instantiate it
normally because its base data type is a custom object with no
constructor. The tool is supposed to be a able to have this
instantiated and it isnt. Until I scroll through its fields in the
debugger.

I called it a quantum error because in Physics the Uncertainty
principal states that the act of observation can change its results.


Any suggestions on how I can mimic what the debugger is doing when I
scroll through the fields so I can find a work around for my code that
is blowing up.

The debugger is going through every visible property and calling it. One of
those calls must cause the object to be instantiated. As far as I can tell,
it only calls properties that are shown, so possibly make the window as
small as possible to get it to only call a few properties to see which ones
make the difference.

Michael
 
A

andyblum

Thanks,

I am writing a routine to loop through the properties and do a get for
each one.
 
A

andyblum

Thanks a lot,

The routine worked, I appreciate the suggestion. Here is the code that
mimicked the debugger getting values.

//This code should be uneccessary however we have
//found that the datawindow will only instantiate
//Beffers when certain properties are accessed
//It happens to finally create the object when
//objectundermouse Value is inspected
Type t;
t = dwc.GetType();
PropertyInfo[] pis = t.GetProperties();
int i = 0;
foreach (PropertyInfo info in pis)
{
info.GetValue(dwc, new object[] { });
if (dwc.PrimaryData != null)
{
break;
}
}
 
A

andyblum

Hey,

Comment 2 helped me, thanks. I am aware that I was referring to the
Heisenberg principle,
however I thought no one else would get it.


Thanks,

Andy
 
R

RobinS

Hey,

Comment 2 helped me, thanks. I am aware that I was referring to the
Heisenberg principle,
however I thought no one else would get it.


Thanks,

Andy

The Heisenberg Uncertainty Principle is one of my favorite
things, topped only by the second law of Thermodynamics.
"Entropy is always increasing." I appear to be running an
experiment right this very moment, judging by the mess
on my desk and its progression...

Robin S.
 
O

Oliver Sturm

Hello RobinS,
The Heisenberg Uncertainty Principle is one of my favorite
things, topped only by the second law of Thermodynamics.
"Entropy is always increasing." I appear to be running an
experiment right this very moment, judging by the mess
on my desk and its progression...

Looks to me as if that experiment of yours has spread to my desk, via some
unexplained entropy transference process. Or maybe all programmers are
alike, after all?


Oliver Sturm
 
R

RobinS

Oliver Sturm said:
Hello RobinS,


Looks to me as if that experiment of yours has spread to my desk, via
some unexplained entropy transference process. Or maybe all
programmers are alike, after all?


Oliver Sturm

If you'd like to truly experiment, I could *send* you some of this
stuff (there's some pizza coupons on the northeast corner) and we
could see if it attracts even *more* stuff to *your* desk. Kind of
like getting one dandelion in the lawn one spring and not doing
anything about it, and then next spring, there's yellow flowers
everywhere!

Robin S.
 
O

Oliver Sturm

If you'd like to truly experiment, I could send you some of this
stuff (there's some pizza coupons on the northeast corner) and we
could see if it attracts even more stuff to your desk. Kind of
like getting one dandelion in the lawn one spring and not doing
anything about it, and then next spring, there's yellow flowers
everywhere!

Yeah well... I'm sure we're not just talking about delightful stuff here,
like dandelions or pizza coupons, but also ugly things like outdated "call
back tax attorney" post-its or used and therefore unstable BHDs (black
hole devices). So if there's a way for me to opt-out of this entropy
distribution program, let me know - I'll be interested!


Oliver Sturm
 
R

RobinS

Oliver Sturm said:
Yeah well... I'm sure we're not just talking about delightful stuff
here, like dandelions or pizza coupons, but also ugly things like
outdated "call back tax attorney" post-its or used and therefore
unstable BHDs (black hole devices). So if there's a way for me to
opt-out of this entropy distribution program, let me know - I'll be
interested!


Oliver Sturm

To quote Homer Simpson, "DOH!" I saw an opportunity to get rid of
some stuff there, but you're too smart for me. Bummer. On the other
hand, you might have missed an opportunity; there's a dozen .Net
books stacked on the northwest corner. (2 stacks; I don't want them
to fall over and kill me.)

The only way to opt out of entropy is to die. Oh, wait, that
won't work either. If I figure out a way, I'll let you know.
For now, I think I'll just prop a trash can under the edge
of the desk, and test Murphy's Law. (Whatever falls off is
the most piece of critical information in the stack.)

Robin S.
 
O

Oliver Sturm

Hello RobinS,
The only way to opt out of entropy is to die.

Nah... I think I'd feel severely compromised by that, maybe even more so
than by the original desk chaos issue.
(Whatever falls off is
the most piece of critical information in the stack.)

That's actually a very interesting idea you have there. I wonder whether
project managers the world over couldn't put that theory to good use...
OTOH, I believe the original Murphy's law is said to state that things go
wrong whenever they have a chance, so having the most important piece of
information fall into your trash can will only work as long as you don't
want it to. As a consequence, I think even the intention of picking out
that important piece of information will probably prevent it from falling
in in the first place. Going further, I should be able to find the fastest
checkout lane in the supermarket by trying to use Murphy's law to find the
slowest. Hm. Something isn't quite right there...


Oliver Sturm
 
R

RobinS

Oliver Sturm said:
Hello RobinS,


Nah... I think I'd feel severely compromised by that, maybe even more
so than by the original desk chaos issue.

The question one has to ask is if you died *at* your desk, would
you just become a part of the chaos? Would they ever find you,
or would they just continue to dump mail and other stuff on top
of you?
That's actually a very interesting idea you have there. I wonder
whether project managers the world over couldn't put that theory to
good use... OTOH, I believe the original Murphy's law is said to state
that things go wrong whenever they have a chance, so having the most
important piece of information fall into your trash can will only work
as long as you don't want it to. As a consequence, I think even the
intention of picking out that important piece of information will
probably prevent it from falling in in the first place. Going further,
I should be able to find the fastest checkout lane in the supermarket
by trying to use Murphy's law to find the slowest. Hm. Something isn't
quite right there...

That's a nice theory. I was thinking that the most critical piece
of information would fall off the stack with the assumption that I
would not notice it missing until it was too late to recover it. I
hadn't considered the idea of it happening intentionally. If that
worked, you could use that method to figure out what piece of paper
on the desk was most critical. However, if you *meant* for it to
happen, then only junk mail would fall off. If you meant
one or the other to happen, then *nothing* would fall off; the pile
would stick to the desk like glue. Not even pulling yourself up
to the desk on your roller chair and banging into the desk
rigorously would have an impact on the stability of the pile.

Construction companies would of course want to figure out how
to utilize this in their buildings, but couldn't, because if
their intention was for the building not to fall down, well,
you can see the pattern. I think this is conceptually the
Heisenberg Uncertainty Principle (whatever is observed acts
differently than whatever isn't), so now we have come full circle.

As for supermarket lines, you should go stand in the line you
didn't mean to stand in, and the minute you get there,
consider leaving. It will speed up as soon as you do.

Robin S.
 
K

Kevin Spencer

Human beings do not die because of entropy. They die because all DNA has a
mechanism built into it, which causes the living entity to grow and rebuild
itself until a set of pre-determined (and as-yet unknown) conditions becomes
true, at which time the mechanism kicks in and the body begins to
systematically deteriorate. The process of old age and death is similar to
the process of puberty and adulthood.

--
HTH,

Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com

Expect the unaccepted.
 
O

Oliver Sturm

Hello RobinS,
The question one has to ask is if you died at your desk, would
you just become a part of the chaos? Would they ever find you,
or would they just continue to dump mail and other stuff on top
of you?

I work from home, so I'm pretty sure I'd be found :)


Oliver Sturm
(Away over Christmas, sorry for delays in replies.)
 
R

RobinS

Hi, Mr. HappyNews, ;-)

I wasn't saying he would die *because* *of* entropy.
I said in order to *avoid* entropy, he could die. Although
that won't really work either, with decomposition and all
that other icky stuff, so it's hardly worth the effort.

Happy Christmahanukwanzaakuh!

Robin S.
 
R

RobinS

Thanks! (I was trying to cover all my bases and be
politically correct. It's exhausting!)

Robin S.
---------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top