|
biggiant22000 wrote: I need help with a programto keep...
Change this to "program to" and you should be good to go. Thanks for allowing us to help.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I have written a CMS that uses the CHTMLEdView class as a HTML editor. The CMS also has a number of additional edit controls for things like a button name, a tooltip etc. When the CHTMLEdView has focus, and I click on one of the other Edit controls, then the cursor is hidden, which is a hassle for editting. When I then click on any of the other edit controls, the cursor re-appears, In other words, I always need to click two different edit controls after using the HTML editor before the cursor appears again. I have tried ShowCursor(TRUE) and ShowCaret() on the edit controls, but nothing seems to help. Has anybody got any ideas on the subject? Would be greatly appreciated.
Regards,
William
|
|
|
|
|
hi!
I want to use a C++ function which applies minimization on a math formula ( http://www.codecogs.com/d-ox/maths/optimization/nelder.php ) but I dont understand how to pass my formula as the first parameter.
There is even an example but I dont understand it...
double f(double *x) {
double r = sqrt(x[0] * x[0] + x[1] * x[1]);
return ABS(r) < 1E-12 ? 1 : sin(r) / r;
}
I dont know what's the unknown. "x"? "r"? Both?
My formula is: http://personal.telefonica.terra.es/web/episodio1/text3.gif
This is what I've made:
for (i=1;i<=numberOfAnchors;i++)
{
errorsquare+= pow( abs( x[i] - xestim + y[i] - yestim ) - distance[i] ) , 2 );
}
errorsquare=errorsquare/numberOfAnchors;
2 unknowns: "xestim" and "yestim".
My question is: how should I code/declare my formula so it is accepted by the C++ function ?
Thanks.
|
|
|
|
|
Well, supposing both your xestim and yestim are independent, you may rearrange your function such a way:
xestim -> z[0]
yestim -> z[1]
so that you'll get
double f (double * z)
{
errorsquare = 0.0;
for (i=1;i<=numberOfAnchors; i++)
{
errorsquare+= pow( abs( x[i] - z[0] + y[i] - z[1] ) - distance[i] ) , 2 );
}
return errorsquare;
}
Now you have the f parameter of the nelder function..
dim is 2 (as you may guess).
The starting simplex points p are up to you (you've to provide, as in the example a 2x3 array), like the eps value and the maxit .
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks, Cpallini...
I guess u removed by mistake...
errorsquare=errorsquare/numberOfAnchors ;
)
|
|
|
|
|
Episodio1 wrote: I guess u removed by mistake...
Of course I forgot it, but you know, such a operation has no influence in finding minimum (you may drop it).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Cpallini, do you know about NelderMead algorithm?
Cause I dont know what initial points to use. I mean...
In that C++ function Points are 2x3 (3 points x-y).
But this function is payware, so I got this one: http://people.sc.fsu.edu/~burkardt/cpp_src/asa047/asa047.html
In this last one initial points are only 1x2, which I dont know what represents.
Code it's already running but I dont get valid points for any initial points.
EDIT: It's OK now. There would be 1 and only initial point. And it should be close to region in which I want to find a minimum. ^^
modified on Monday, April 27, 2009 7:10 PM
|
|
|
|
|
Receiving gps coordinate to web browser laziness program
By the way, coordinate is not carried cost
Teach where is done wrongly
source down
|
|
|
|
|
yunpil wrote: laziness program
At least you are consistent with that...
|
|
|
|
|
I remember walking in the park one day and... Wait, wrong story.
I have sent you the requested code. I wrapped it in a plain brown sack for your privacy. When you are done with it, please mail it back to me. Enjoy.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All
I have two path source(LPCSTR pF)and destination(LPCSTR pT).I am getting values in pF at the run time like this pF="C:\\Hello\\adaf\\trt" and pT="C:\\Backup."
But when code start to copy cammand then it make backup but it's not make in proper way.It's make like that(C:\\Backup\\Hello,C:\\Backup\\adaf and C:\\Backup\\trt).But i need to copy in full path like that(C:\\Backup\\Hello\\adaf\\trt).I am ueing this code.
CFileOperation fo;
CString tr=sourcepath;
int nLen = tr.GetLength();
LPCSTR lpszBuf = tr.GetBuffer(nLen);
tr.ReleaseBuffer();
LPCSTR pF=lpszBuf;
LPCSTR pT="C:\\Backup";
if(!fo.Copy(pF,pT));
Plz help me
|
|
|
|
|
MsmVc wrote: CFileOperation
What is it?
MsmVc wrote: int nLen = tr.GetLength();
LPCSTR lpszBuf = tr.GetBuffer(nLen);
Why are you misusing CString::GetBuffer ?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If you are use ;;ShellFileOperation you need to end the last file buffers with 2 (two) zero bytes. Read the docs from MS
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
What's wrong with:
CFileOperation fo;
if (! fo.Copy(sourcepath, "C:\\Backup"))
; That aside, have you stepped into the Copy() code to see when/how it is failing?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all
The framework calls OnKillFocus() member function immediately before losing the input focus.
Just like that is there is any function that we can override when the window regains the focus.
Thanks and regards
Deepu
|
|
|
|
|
What about OnSetFocus [^]?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is there is any message handler for this function
|
|
|
|
|
Is is a message handler (it handles WM_SETFOCUS ).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
I have an interface say
IABC
{
HRESULT fun ();
}
library PQR
{
coclass MyClass
{
[default]interface IABC;
};
}
This works fine . But i need to do #import inside a library block
(This is required for passing an argumnet to fun(RecordSetPtr *ptr) )
Now I have written my .idl as
library PQR
{
#import(..\..\..\MSADO15.dll);
interface IABC
{
HRESULT fun ();
}
coclass MyClass
{
[default]interface IABC;
};
}
What is the diffrence between these two implementatiions..
Please provide your comments.
Thanks
|
|
|
|
|
Perhaps this[^] will help.
Steve
|
|
|
|
|
pandit84 wrote: #import(..\..\..\MSADO15.dll);
You're expecting #import to work in an IDL file? Don't think so - I think you want import "MSADO15.idl";
pandit84 wrote: But i need to do #import inside a library block
(This is required for passing an argumnet to fun(RecordSetPtr *ptr) )
Really? This IDL seems to compile and build fine, even though the itnerface is outside the library declaration:
import "oaidl.idl";
import "ocidl.idl";
import "MSADO15.idl";
[
object,
uuid(7CD26371-4A6B-4234-A024-6690A53CA450),
nonextensible,
helpstring("Itest Interface"),
pointer_default(unique)
]
interface Itest : IUnknown
{
HRESULT GetCount([in]_Recordset* rs, [out]int* num);
};
[
uuid(D39DD965-FC96-4C0A-AA62-CA3F5F117685),
version(1.0),
helpstring("cccc 1.0 Type Library")
]
library ccccLib
{
importlib("stdole2.tlb");
[
uuid(F8AAE058-76E9-4F2C-995A-FB5B6565CED6),
helpstring("test Class")
]
coclass test
{
[default] interface Itest;
};
};
A quick test indicates that putting the interface definition inside the library definition makes little to no difference to the generated code.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have developed an application using MFC dialog based application in visual studio 2005.
I am trying to paint the title bar of my application.I have included the OXCaptionPainter
Class in my project and other related include files(OXDllExt.h, OXCaptionPainter.h, OXRegistryValFile.h, OXMainRes.h, OXHookWnd.h, utbstrop.h, UTB64Bit.h).
but Build fails showing the following error.
**********************************************************************************
1>Linking...
2>c:\program files\microsoft platform sdk for windows server 2003 r2\src\mfc\afximpl.h(145) : error C2011: 'CPushRoutingFrame' : 'class' type redefinition
2> c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxpriv.h(747) : see declaration of 'CPushRoutingFrame'
*************************************************************************************
Kindly help me to use this class of Ultimate ToolBox 93.
Thanking in advance
NamitaS
|
|
|
|
|