|
thats a very good idea, thanks! I have always just automatically given them both the same version numbers, without actually thinking about why there are two different fields.
|
|
|
|
|
Can any body tell me how can i get client area dimensions(width & height) in millimeters?
|
|
|
|
|
mm relative to what ? The screen you're running on ? To do that, you need to know the screen resolution ( easy ) AND the screen size ( not so easy ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Two quick queries:
1. I have programmed a little network performance monitor. It monitors a set of remote hosts over a network. It gets the CPU statistics and all gets collected at one of the remote hosts (say primary remote host, holding procValues[n][4], 4 CPU floating numbers per n remote hosts).
Now, I want to transfer this data set (double procValues[n][4]) over a TCP or UDP network connection to a local host for graphing and storing in a database tool.
I've read Beej's Networking Guide http://www.ecst.csuchico.edu/~beej/guide/net/ and going to follow his code.
However I don't know how am going to send a double[n][4] over the network efficiently without hogging the network. Is the most efficient way just converting double[n][4] into a string?
Am using a sleep(1) function to set the frequency of 1 second to read the cpu statistics.
If a sending function takes more than the frequency of "cpu statistic collecting" then am going to get lots of missed out data... no wait it wouldn't be perfectly synchronized to the exact second, it will be lagged behind. Maybe thread the network transfer so that the frequency of "cpu collecting" remains precisely every second?
What are your views?
2. How does one create/use threads in C, AND C++? Do threads differ in usage in C and C++?
|
|
|
|
|
kevingpo wrote:
Am using a sleep(1) function to set the frequency of 1 second to read the cpu statistics.
Sleep(1) = 1 ms wait time. Quite difficult/impossible to reach in a Win9i/2000/XP environment without any other kernel-patch.
kevingpo wrote:
Is the most efficient way just converting double[n][4] into a string?
From my point of view it's the way, you have to pass a parameter telling the type of data you are sending or preassumed that all the data are from a certain type.
kevingpo wrote:
Maybe thread the network transfer so that the frequency of "cpu collecting" remains precisely every second?
You'll have to separate in different threads the data treatment from the data transfer and try different thread priorities to accomplish it.
kevingpo wrote:
2. How does one create/use threads in C, AND C++? Do threads differ in usage in C and C++?
Depends on the implementation of C/C++ you use, but:
In C++: HANDLE CreateThread(LPSECURITY_ATTRIBUTES secAttr,
SIZE_T stackSize,
LPTHREAD_START_ROUTINE threadFunc,
LPVOID param,
DWORD flags,
LPDWORD threadID);
In C using libpthread:
int pthread_create(pthread\_t *tid, const pthread\_attr\_t *tattr,
void*(*start_routine)(void *), void *arg);
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
1 11 55 165 330 462 462 330 165 55 11 1
1 12 66 220 495 792 924 792 495 220 66 12 1
<note: the="" figure="" is="" x'mas="" tree="" shape="">
Write a function tat obtains the product of two matices. The matrix product of two matrices {aij} and {bij} is the matrix {cij} whose ijth elements cij (ie, the element in row i and column j) is defined by the formula.
cij = ai0b0j + ai1b1j +ai2 b2j +...(ai,n-1)(bn-1
with regards
sunny
|
|
|
|
|
This is called homework. The idea of homework is to solidify the things the teacher was showing you in class, no doubt while you were browsing the web for pr0n. It's also a chance for you to show that you know how to do your own research.
We don't do homework here. Try to write this code yourself ( it's really pretty easy, hint: look up 'nested loops' in your C++ book ), and if you get stuck, post CODE, rather than the homework question, and SPECIFIC questions about where you are stuck. Then I'll be the first to try and help you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
int n,i,j;
int a[i][j];
int b[i][j];
int c[i][j];
for(i=0;i
|
|
|
|
|
And what's the question ?????
|
|
|
|
|
sunnymoe wrote:
c[i][j]=c[i][j]+(a[i][j]*b[i][j])
All these arrays are uninitialised, they have nothing in them. And unless the c[i][j] array is initialised to be all 0, this line will add the product to garbage that is there already. Given that i and j will both have their value only once, I think you need to change it to:
c[i][j]=(a[i][j]*b[i][j])
and also, if you have < in your code, there's a check box below the text window that you need to check so they don't get regarded as HTML. That's why your code is not all visible.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
Then I'll be the first to try and help you.
Are you sure that you'll be the first who sees his post? You have a lot of competitors here
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
Are you sure that you'll be the first who sees his post? You have a lot of competitors here
Have you seen the sheer number of posts Christian makes? Much less posts in EVERY board? I think he has a direct line to the SQL servers. I have often wondered if Christian isn’t bob in disguise.
[I hope he doesn't get offended by this]
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
sfdougl wrote:
Have you seen the sheer number of posts Christian makes?
I've seen him answer to MANY posts, but sometimes the mass of other posters here are a little bit faster.
sfdougl wrote:
I have often wondered if Christian isn’t bob in disguise.
I think that even our little green alien has to sleep. Talking about bubble head bob, don't they sell plush toys of him around here?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I've seen him answer to MANY posts, but sometimes the mass of other posters here are a little bit faster.
Touché
Bob Stanneveld wrote:
don't they sell plush toys of him around here?
I have not seen plush toys but there is a coffe cup and other misc items availible.
Code Project stuff[^]
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Bob Stanneveld wrote:
Are you sure that you'll be the first who sees his post?
No, especially if he posts while I am asleep
But what I was trying to say was not 'I will be the one who answers you', rather, 'although I've been rude this time, I will be very happy to help you if you ask a specific question and try to do your own work first.'
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
look in my VisualCalc and search for the nCp(n, p) function...
otherwise, do the homework by yourself
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i just want to modify the height of the header in ListCtrl ,
althought I has tried befor by doing that:
in the CMyHeaderCtrl (: public CHeaderCtrl) of DrawItem function
i done it like that lpDrawItemStruct->rcItem=rcNew ,and rcNew is the exact size or position i want ,but failed!
would you like to tell me how to modify the height of the header in ListCtrl?
mail to me :jkzhang88@tom.com
thank you!
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
I finally go the hang of creating custom controls in VC++6 MFC Wizard.
I now need to create some custom controls in Visual C++ .NET (EditBox based). From what I've been reading, the way to do this in .NET is to create the contol in a .dll made with a "Managed C++ Class Library" project.
Problem is, I don't want to have to link a .dll. I want the custom contol compiled right into the main program. How can I make a custom control that is compiled right into the project?
Thanks.
|
|
|
|
|
I'm almost certain that your VC code will work fine ( a class derived from the text control ). Certainly I don't see any reason why you couldn't do that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can use what is essentially the same C++ from v6 in the .net version. You do NOT have to use any of the managed code languages if you do not want to.
Managed code is not appropriate for my company's apps so we don't use it.
|
|
|
|
|
Hi everybody.
This is my problem, when i try to compil my ddl (with vs.net 2003), i have these errors:
<br />
Linking...<br />
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification<br />
LINK : error LNK2020: unresolved token (0A00002B) std._Mutex.__dtor<br />
LINK : fatal error LNK1120: 1 unresolved externals <br />
And i really don't know how to solve this.
Can somebody help me?
|
|
|
|
|
Are you importing System and System.Threading in the location that the Mutex is used? Basically you are using a Mutex object in some form or another but you are not properly importing the libraries that provide the underlying code for it. This is what MSDN says:
Linker Tools Error LNK2020
Similar to an undefined external error, except that the reference is via metadata.
To resolve:
Define the missing function or data, or
Include the object file or library in which the missing function or data is already defined.
|
|
|
|
|
For my librairie, i used the new Class Library (.NET) project in vs.net 2003.
Maybe the error come from there.
I just add id3libD.lib to the linker's options and include <id3 tag.h=""> and <sstream>. My class inherit from ID3_Tag but except that i just use things like int, string, stringstream and char*.
I (tried to) read that thing:
msdn
In fact when you start a new Class Library (.NET), you automatically have a project that is all ready designed (i can't choose an empty project). And automatically you have this declaration for the class:
public __gc class Class1
And it seems to have a link with mutex. I was constrained to erase public __gc in the previous declaration because of my class inherit from ID3_Tag which is not a __gc class.
But that's all i found. So i supose that the project pre-configuration make that it expects a __gc class. But it is just a suposition and i don't know what to do.
P.S: After others tests, it appear that it is the std::stringstream which cause the error. What library is missing?
|
|
|
|
|
Does anyone know the "student's distribution probability function"? I have found several examples online but they are not easily interpreted to C++ source code (actually they are impossible to interpret...at least the ones I have found so far). I basically need to have a function that I pass in the degrees of freedom and the significance level and have it return the significant probability level such that I can compare it to results I have and determine if my results are indeed significant or not. (This function appears to compute a point on a Gaussian curve where anything in the middle is considered insignificant and anything outside is considered significant.)
You can find tons of precalculate charts for this, but not the actual formula. So for example: Say I have calculated the correlation coefficient for a vector of size 10 and I want to determine if my results are significant for a 0.05 (i.e. 95% or greater) significance level (which according to the tables would be 0.55 or greater). So I need a function that would be:
0.55 [Significant Probability Level] = ProbabilityFunction(10 [degrees of freedom], 0.05 [Significance Level]);
I realize this is probably not the normal types of questions people here post/answer...but for anyone wanting a challenge (or happens to already have this source code) and would be nice enough to reply...I would greatly appreciate their efforts. Thanks!!
|
|
|
|
|
I am using Ivor Horton's "Beginning Visual C++" to learn Visual C++. When compiling one of the exercise programs, I get 4 errors, which are
"c:\program files\microsoft visual studio\vc98\include\zmouse.h(138) : error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'"
c:\program files\microsoft visual studio\vc98\include\zmouse.h(138) : error C2433: 'HWND' : 'inline' not permitted on data declarations
c:\program files\microsoft visual studio\vc98\include\zmouse.h(138) : error C2501: 'HWND' : missing storage-class or type specifiers
and finally -
c:\program files\microsoft visual studio\vc98\include\zmouse.h(138) : fatal error C1004: unexpected end of file found.
Does anyone know what I am doing wrong? The code has no reference to zmouse.h only one include, #include <afxwin.h>. I tried using #include "stdafx.h" instead since that had worked on an earlier example, but I still get the same errors.
Does anyone know what I am doing wrong?
|
|
|
|