|
Thanks to all of you on yours suggestions!!!!!!
|
|
|
|
|
Hello,I have the following project and I have tried and tried but can't seem to get it. Can anyone help?
I have to write a program to campare the secant method with newton's method for finding the roots of each function:
x^3 - 3x + 1 with starting point Xo=2
x^3 - 2 sin x with starting point Xo=.5
The instructions also state to use the X1 value from Newton's method as the second starting point for the secant method and to print out each iteration for both methods. I appreciate any help.
|
|
|
|
|
hi,
first you must know how to create a simple application and include graphics in it. I can't learn that, if u don't know buy a book like "C++ for the dummies"
I will assume that you have at least basics skills in developing apps and will just describe the method you must use to make your project ; especially i will not discuss implementation solutions you use, nor the old-fashioned question of object oriented versus linear
For the numerical :
first : write on paper both newton and secant mehod, analytical (ie on paper) write the expresion of both methods' algorithm in function of Xo and the function i name F. Dont developpe F, use it as a general function.
second : write a unit that can trace graphically any functions : trace the axis, check with usual functions you knox (log , cos...) then test your two asked functions, name them f1 and f2.
make your grid and your mesh depending of variables and use these to create a zomm(in and out) that you can use while the app is running.
third : in another unit write a method that give a solution for each algo(secant/newton) in function of Xo, F, the maximal error requested (MER) and the number of steps(N).
if N=0 say N = maxInt and if n=maxInt-1 exit with an error (maybe yours
check it with the simplest functions whose roots are trivial
fourth : put everything together and answer what you are ssked.
critic the different methods, i guess that's where your professor want to lead you.
for personal purpose can u tell me where/major/university/level of your studies. just for curuiosity
free exchanging : france, maajored in physics, PhD in computer science applied to physics in paris
if you are a great C++ developper you can add some stuff :
- possibility using keyboard naturally to enter any usual function and compare each method for it, auto-mesh, auto-Xo and auto-grid
- add others root finding methods (polynoms solving, multiples roots, properties of F and its derivative...)
- point at problematic cases
good job and if you want details ask
PS : if you are very rich, being jobless, i could help you more and more....
styx
|
|
|
|
|
I am trying to Overlap an image (bitmap, jpg, whatever) onto a live video stream. The idea is that a user is supposed to line up the camera with known lines to make future calculations eaiser.
What the intent is that the user will see a transparent (ghost) image of what the camera SHOULD be pointing at and line up the camera to match this ghost image. I find this idea better than simply displaying this image on the side. An overlay would be ideal.
Has anyone done something like this or have any clue how I would do this? Would I need Direct X? VFW?
Thank you in advance!
|
|
|
|
|
tlerner wrote:
I am trying to Overlap an image (bitmap, jpg, whatever) onto a live video stream.
DirectShow is perfect for this. It supports mixing video streams (or videos streams and a static bitmap) natively. Look up the Video Mixing Renderer (VMR).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm running Visual Studio C++ .Net 2003, on a Win XP machine.
I'm wanting to put together an application that has access to the USB 2.0 ports on my computer, so I can connect up some devices my team is working on.
Any ideas how to do this?
Thanks for the help.
|
|
|
|
|
This resource might help [^]
and another [^]
Steve
|
|
|
|
|
I'm making a small utility app that uses ReadDirectoryChangesW(). Everything works fine while the directory I'm watching is on my local machine. But when I try to monitor a network folder, I get the error "An unexpected network error occurred." everytime a file is added (or any other type of file operation in that folder). Does anyone know what's going on? I have complete rights to the folder, so I would guess my app does too, but I may be wrong about that.
[insert witty comment here]
bdiamond
|
|
|
|
|
Check GetLastError() after ReadDirectoryChangesW(). That should tell you what's wrong.
I'm not sure that you can use ReadDirectoryChanges on drives other than a local drive. Check the docs. I certainly can't see it working on non-Windows drives.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
GetLastError() returns "An unexpected network error occurred.". I've gotten it to work on network drives, but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network to look like a regular windows folder.
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network
I would be surprised if it worked on Unix drives so this makes sense.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
bdiamond wrote:
but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network
I would be surprised if it worked on Unix drives so this makes sense.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It works fine when I compile under VC 6.0 but when I convert the project to a VC .NET "solution", the following line will return a NULL pointer:
Code:
CWnd* pWnd = GetParent()->GetDlgItem(edt1);
Any helps?
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
Please advise MFC libraries for drawing diagrams/charts. As tried I couldn't find anything suitable for me.
|
|
|
|
|
There are none, just the wrappers on the core GDI stuff that lets you draw lines, etc. There is no fully fledged chart drawing code in MFC. You have to write it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
If You Want Charts, Why Don't You Use office Web Components(OWC)?
by
baijumax
|
|
|
|
|
I really like the Smart Tag control in Office XP. Have anyone an idea how to make such a control in your own program?
|
|
|
|
|
hello,
The program that I am making needs to allow the user to upload a file from his harddisk by pushing a button just like he would normally do on a php page.
The file must be uploaded via php on remote server of course.
I am trying a trick I saw on a website since php no longer supports just plain uploading without the user pressing some kind of button I have beet trying to simulate a button pushing like this:
<br />
<br />
strcpy(lpContentLength, "Content-Length: %d\r\n"); <br />
strcpy(lpContentType, "Content-Type: multipart/form-data; ");<br />
strcpy(lpPOST, "POST");<br />
strcpy(lpMimeHeader,<br />
"-----------------------------7d414e351603fa\r\n"<br />
"Content-Disposition: form-data; name=\"upload\"; filename=\"%s\"\r\n"<br />
"Content-Type: application/octet-stream\r\n"<br />
"\r\n"); <br />
strcpy(lpMimeTail,<br />
"\r\n-----------------------------7d414e351603fa\r\n"<br />
"Content-Disposition: form-data; name=\"submit\"\r\n\r\n"<br />
"Upload Files\r\n"<br />
"-----------------------------7d414e351603fa--\r\n");<br />
strcpy(lpUserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Win32)"); <br />
<br />
sprintf(szMimeHeader, lpMimeHeader, lpFilename); <br />
sprintf(szMimeTail, lpMimeTail);<br />
MessageBox(0, szMimeHeader, "ada", MB_OK);<br />
MessageBox(0, szMimeTail, "ada", MB_OK);<br />
dwMimeHeaderLen = strlen(szMimeHeader);<br />
dwMimeTailLen = strlen(szMimeTail);<br />
then of course I read the file, stick the MIME at the end of it and use win32 internet functions to get the data to the php waiting on the other side but it doesn't work, anyone know why? Is the mime header wrong?
I could provide the rest of the code also if you think there might be something wrong with it.
|
|
|
|
|
Hello Everybody
I am using VC++ and trying to insert records into an Excel 2003 sheet using ODBC.
The table has been created and the ranges named but it is only inserting one record and then I am getting rhe "cannot expand named range" error.
Now when I change the range definition I am getting a "spreadsheet is full" error.
I am not sure what is going wrong and any help would be greatly appreciated.
Here is my code for inserting:
CDatabase db1;<br />
if(!db1.IsOpen())<br />
db1.Open(NULL,FALSE,FALSE,_T("ODBC;Driver={Microsoft Excel Driver (*.xls)};DSN='';DBQ=TT_Database.XLS;ReadOnly=False"),TRUE);<br />
<br />
strSQL1 = "INSERT INTO tbl_AllCaptured(TickerSymbol,FIELD_PRICE, FIELD_VOLUME, DateOfCapture) VALUES('GE',25.57,45,#10/10/2000#)";<br />
<br />
db1.ExecuteSQL(strSQL1);<br />
db1.Close();
Thanks & Regards
Satish Kumar Putcha
INDIA
|
|
|
|
|
Hi,
Everybody. Do any one know how to write flash programming in VC++. Means how to parse SWF files and and how to run it ... etc...
Thanks in advance.
DTP
If you have in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
There's a flash SDK for creating swf's. If you want to view them, I'd say you want to embedd IE in your app.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
If you want to view them, I'd say you want to embedd IE in your app.
Yep, but embedding the Flash OCX control is a lot easier
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Maybe the macromedia Flash SWF SDK can help
Download it Here[^]
Or
The Macromedia Site[^]
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
I'm attempting to write a managed wrapper interface to a native C++ class such that I can access it from within my C# code.
I'm using Visual Studio .NET 2003 on Windows 2000.
I started a new solution: Visual C++ Projects > Class Library (.NET)
My Stdafx.h file has the following in it:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <iostream>
using std::cout; using std::endl;
In the Solution Explorer, under Source Files I have the following:
1. AssemblyInfo.cpp
2. BiquadCode.cpp (native C++ code)
3. DSPWrap.cpp (the wrapper code)
4. Stdafx.cpp
Under Header Files, I have:
1. BiquadCode.h
2. DSPWrap.h
3. resource.h
4. Stdafx.h
I've "included" the Stdafx.h file in the first statement of DSPWrap.cpp.
On a build attempt, the code generated a C1010 error. For the files BiquadCode.cpp and BiquadCode.h, I've now set the precompiled header option as "Not using precompiled headers".
However, this throws a C1034 error
<path>\DSPWrap\DSPWrap\Stdafx.h(9): fatal error C1034: windows.h: no include path set
My questions are as follows:
1. How do I get this code to compile?
2. Where exactly do I need to "include" the Stdafx.h file? Do I need to do it only once in the wrapper code file?
Thanks in advance!
|
|
|
|
|
Hi,
In my application, I draw in a dialog with OnPaint() member function.
It is functionning well when the dialog is created and displayed.
In the dialog, I can change the dimension of the drawing. But I am not able to update the drawing unless I quit hte dialog and I come back.
How can I update my dialog on the fly ?
Thanks,
Claude
|
|
|
|