|
Here is the definition of reciprocal: http://www.mathleague.com/help/fractions/fractions.htm#reciprocal
|
|
|
|
|
http://en.wikipedia.org/wiki/Reciprocal_%28mathematics%29
1/X so you would take the shutter speed, square it, then divide 1 by it.
|
|
|
|
|
For reciprocal see here [^].
And of course you don't need Pow to take the square of a number, just multiply it by itself.
Perhaps what you need is:
ShutterSpeed = 1.0/(OriginalValue*OriginalValue);
Please note that some care must be taken when OriginalValue approaches zero...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Maybe wrap it in a
if (OriginalValue != 0)
{
}
test.
|
|
|
|
|
StevenBee wrote: if (OriginalValue != 0)
{
}
Maybe you still got a divide by zero exception!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: And of course you don't need Pow to take the square of a number, just multiply it by itself.
I thought he meant n-th root from number
|
|
|
|
|
thanks a lot. i'll try that tonight.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
So...Have a nice night!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have to generate and send snmp trap from my application/service on-start or on-stop in c#.net. I have been googled more than 15 days but unable to get any idea how to do this.
I am trying with winsnmp.dll and wmi,but I am newcomer to these and ultimately gets failure.
plz help how can i achive this
yours
ashis
ashis
|
|
|
|
|
Hi,
I want to create a Custom collection Class
Where i can store values by just
CollectionObject.Key=Value;
Is it Possible to do like this.
If not is it possible to create dynamic properties to a class.
Please Help me
Thanks
Sakthi.
|
|
|
|
|
Hello,
You mean like this?
public object Key
{
get
{
return this.List[List.Count-1];
}
set
{
if(!this.List.Contains(value))
{
this.List.Add(value);
}
}
}
All the best,
MArtin
|
|
|
|
|
Hi Martin,
Thanks for your reply.
CollectionObject.Key = Value;
Key here refers the key to be stored in the collection class for
Reference.
Forexample
Dictionary<string,string> MyDict=new Dictionary<string,string>()
MyDict[Key] = Value;
Instead of using [](Square Braces i just want to use dot(.) Symbol.
Regards,
Sakthi.
|
|
|
|
|
Apart from, that I don't understand what you mean.
Why would you whant to do something like this?
|
|
|
|
|
This is a really strange idea! All possible keys must be known at compile-time.
However, technically this can be achieved by adding a Dictionary member to you custom Collection and provide a property for each possible key that just wraps the indexer of the dictionary.
Regards,
Tim
|
|
|
|
|
Tim Paaschen wrote: This is a really strange idea!
I do agree!
Tim Paaschen wrote: and provide a property for each possible key
Think about that again! (He will set a long time infront of his computer, and than one day his heart will stop beating)
As we all don't whant him to die infront of the computer writing this "strange" program, we should tell him to search for a better solution!
All the best,
Martin
|
|
|
|
|
Hi,
Thank you very much for your Suggestion and Concern.
Regards,
Sakthi.
|
|
|
|
|
Martin# wrote: Think about that again! ...
I never said that it is a good idea - just that it is technically possible.
Regards,
Tim
|
|
|
|
|
Hello (Hallo) Tim,
Tim Paaschen wrote: I never said that it is a good idea
I know, and my answere was more meant as a joke than a critic on your statement.
Tim Paaschen wrote: just that it is technically possible
Technically possible, would be a set of keys which he defines during design time.
"All possible Keys" is not technically possible!
All the best (Noch einen schönen Tag)
Martin
|
|
|
|
|
Hi friends..
I have designed one simple windows application in which i am retrvng data from data base and populating it to the grid..I build the solutn and have an .exe file for the same..
Now I am designing a web page with a button on it..I want that windows application to run on click of that button ..though I used java script and used windows.open(".exe path name")..i m still facing the problem..can anyone plz help me..
regards,
Rahul
|
|
|
|
|
|
Hi Tarakeshwar..Thanks a lot..url given by u solved my problem instantly..
|
|
|
|
|
i am using an xml file which has an optional atributes.
Now i want to know that there is no attribute for the node dynamically
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
How are you examining the XML ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
my xml file is
<?xml version="1.0"?>
<lasers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="laserProp.xsd">
<laser LaserName="Laser1" ModelName="Nufern v1.0" SerialNo="1" ManufacturerName="Nufern v1.0" Maximumpower="200">
<properties>
<image>CW-Waveform.jpg</image>
<WaveTypes>
<WaveType Name="CW Waveform" url="CWwaveform.html" isavailable="true"/>
<WaveType Name="Relaxation Oscillation Envelope" url="RelaxOscillation.html" isavailable="true"/>
</WaveTypes>
<tabular>
<property id="40" name="IP" prgbar="false" selected="false" pwd="true" units="C" gauge="false"/>
<property id="200" name="Output Power" prgbar="true" selected="true" min="0" max="200" pwd="false" units="W" gauge="true" amberthresholdval="201" amberwarning="Output Power is near upper limit."/>
</tabular>
</properties>
</laser>
</lasers>
I am reading xml like this
xmldoc2.LoadXml(objXmlTasks.decrypt());
XmlNodeList xmlchildnodelst = xmldoc2.SelectNodes("/lasers/laser[@LaserName='" + laseridval + "']/properties/tabular/property[@name='" + childLaserSelectedName + "']");
for first child node in tabular node there is no attribute("amberthresholdval") so below statement is giving exception
xmlchildnodelst.Item(0).Attributes.GetNamedItem("amberthresholdval").Value
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
You could extract the node and test the attribute to see if it is null. if it is null the attribute is not present.
|
|
|
|