|
Hello everyone..
I'm currently doing my Masters in Computer Network Engg and I have decided to do my Final semester project in optimisation of firewalls.
I'm thinking of implementing firewall optimisation using rule re-ordering and rule conflict detection, but I don't have a clue on how to get started.
I got to know that I can make use of Windows Firewall API (NetFwTypeLib) and work on top of Windows Firewall but I'm not quite sure if this would help me or not.
If you have done anything similar or have some pointers for me please guide me.
Thanks.. 
|
|
|
|
|
SujithKG wrote: I don't have a clue on how to get started. Try doing some research into the subject, or choose something you do have a clue about.
|
|
|
|
|
//print function
CString fmt(double db)
{
CString cs;
cs.Format("%f", db);
return cs;
}
//problem
void TheDlg::Test00()
{
const double dbInf = 1.0/::sin(0);
const double dbZero = (::fabs(::cos(3.14159/2))<0.9)?0:1;
CString cs;
cs += fmt(dbZero)+"\r\n";
cs += fmt(dbZero * dbInf)+"\r\n";
cs += fmt(0 * dbInf)+"\r\n";
MessageBox(cs);
}
above dbZero only has 2 possible values : 0 or 1 - see line 1;
output:
0.000000
-1.#IND00
0.000000
output of line 2 shows that dbZero is zero.
output of line 3 shows that dbZero is not zero, since it is different from output of line 4.
funny thing is that if change line 1 to:
const double dbZero = (0.1<0.9)?0:1;
Then all outputs are zeros.
Why?
How to make dbZero as a true zero in problem code?
|
|
|
|
|
Floating point numbers are not exact. See: Comparing Floats[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Just got a more consistent behaviour on Linux:
#include <cstdio>
#include <cmath>
void out_double( double db )
{
printf("%f\n", db);
}
int main()
{
const double dbInf = 1.0/::sin(0); const double dbZero = (::fabs(::cos(3.14159/2))<0.9)?0:1;
out_double( dbZero );
out_double( dbZero * dbInf );
out_double( 0 * dbInf );
}
outputs
0.000000
-nan
-nan
[update]
The same program, on Windows 8, compiled with Visual Studio 2012, produces
0.000000
-1.#IND00
-1.#IND00
[/update]
modified 28-Dec-15 16:54pm.
|
|
|
|
|
Hey there !!
LOOK OUT - LOOK OUT - LOOK OUT - LOOK OUT -
The problem is NOT on the dbZero - but on the dbInf.
That explains everything you see.
dbInf is 1 divided by zero, which is undefined.
Anytime you try to use this value, you´ll have problems.
That´s why you CAN print dbZero, but not dbInf or (dbZero * dbInf).
Ok ?
modified 21-Jan-16 14:44pm.
|
|
|
|
|
Greetings,
I have a database creation script. I've run the script after changed the path within the 'FILENAME' option to create the database on an external hard disk and I was able to see and select data from tables as the script run with no errors. However, when I tried to connect to the database from an application and read data from database tables, an exception thrown for SQL Server error 823 "The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000132000 in file 'Database name'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.". I've tried to run database consistency commands against it but they did not carried out and I got an error message. Also when I tried to drop or recover the database, dropping and recovering process failed. Finally, I had to make the database offline then I dropped it. I need to create such database on my external hard disk not on my primary one. Can anyone help?!!!
|
|
|
|
|
This has nothing to do with C/C++. Please use the Database forum.
|
|
|
|
|
Yeah sure I know. It is my fault I forgot to check in which forum I am posting my question. Sorry, I need now to remove the post from the C/C++ forum.
|
|
|
|
|
Amr.Mohammad87 wrote: Sorry, I need now to remove the post from the C/C++ forum. Can't be done now that your OP has been responded to. At best, it's content will be replaced with "message removed" and all replies will remain intact.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
My English is very pool,pardon me.This is my first time here.Today I come here to introduce a C++ program library which written by myself.This library called Covariant Graphics Library.This library can run on Linux,based on C++14 standard.If you have some questions about me and my library,just tell me.
|
|
|
|
|
I don't know how to introduce my program because of my pool English.I'm just a normal senior high school student.
|
|
|
|
|
|
|
The only way your library to become popular is to write an article that
describes the basic ideas as well as demonstrates the library usage. 
|
|
|
|
|
CSDNbuxingma?By the way,poor instead pool
|
|
|
|
|
This program doesn't compile and gives me error "Conficting types of L search" . I ran out of all trials and I am so confused why the heck it gives me this error . I would appreciate your contributions to solve my problem .
the function does front back search of an array, if any number matches it sends back its address.
#include <stdio.h>
int main(void) {
int arr []= {1,2,3,4,5,6,7,8,9,10} ;
int req = 5;
Lsearch(arr,&req,10,4);
return 0;
}
void *Lsearch(void *base,void *key,int n,int elemsize)
{
for(int i = 0 ; i<n;i++)
{
void *elemAddr = (char*)base + i*elemsize ;
if(memcmp(key,base,elemsize)==0) return elemAddr ;
}
return NULL ;
}</pre>
|
|
|
|
|
You failed to include a function prototype at the top of the program thus:
void* Lsearch(void*, void*, int, int);
int main(void) {
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .
|
|
|
|
|
Either
a) supply a prototype for Lsearch() before it is called
or
b) put the definition of Lsearch() before the definition of main()
|
|
|
|
|
Thank you so much, it worked very well ^_^ , excuse my ignorance still new in this .
|
|
|
|
|
Hi
I try to create my own GroupBox (CButton class with BS_GROUPBOX style) control but that class doesn't get any messages from the mouse: WM_MOUSEMOVE, WM_LBUTTONDOWN, WM_LBUTTONUP and etc.
I can't understand why.
Can anyone help me?
|
|
|
|
|
|
I added to .h
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
and to .cpp
ON_WM_MOUSEMOVE()
...
void CMyGroupBox::OnMouseMove(UINT nFlags, CPoint point)
{
}
That works for simple CButton-derived class but with BS_GROUPBOX style it's not work
|
|
|
|
|