|
If you have access to the dll sources, you can try changing the dll to export two functions - Func1 to load (and append) the data, and Func2 will process the loaded data. Then break your data into smaller blocks and call Func1 until all data is loaded, then call Func2 to handle them.
...Plug & Pray...
|
|
|
|
|
call Func1 until all data is loaded, then call Func2 to handle them ....
Does this mean that, I am trying to access the data before it is loaded? I am not sure what we mean "Data loaded" here. This may sound primitive question. But I will appreciate further explanation.
Thanks and regards,
Shrinivas
|
|
|
|
|
I think the problem is on passing large amounts of data as parameters. Since you say it works with smaller blocks, what I suggest is break the large data into smaller blocks and call Func1 to pass them to the dll one by one.
Finally when you have passed all the smaller blocks to the dll, call Func2 to process them all together as one.
|
|
|
|
|
Hello
I am intermediate level programmer and i am having trouble in using MsChart componant in VC++. In documentation its written that i can directly use database as datasource if by using grid and ADO. It works perfectly in VB as per net examples and experiences of ppl i talked to. But how to use that feature in VC++ ?
Well i have database like following
Name Value Time
a 10 12-00
a 20 12-05
a 30 12-10
b 40 12-10
b 70 12-06
b 90 01-00
Now what i want to plot is two line graphs of a and b in the same chart.
What i have with me is the query which gives me above data.
Is there any other simple method to do above thing ?
Thanking you in advance
Bhushan
|
|
|
|
|
For compression and encryption experts out there.
Is it wise to apply encrytption algorithm after the compression?
Or there is already some way of achieving both compression and encryption at the same time?
Any inputs are welcome.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
To encrypt:
Plain data -> compress -> encrypt -> final data
To decrypt:
Final data -> decrypt -> decompress -> original plain data
Never try to compress something encrypted. If the encryption algorithm is any good then the encrypted data shouldn't be compressible, not even by 1%. So always first compress then encrypt.
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
yes, both at one time can be possible but is not very wise.
i propose you compress your files and then encrypt it by e.g. AES or BlowFish.
By the way: compression improves the encryption result because it is much more difficult for brute force attacks to identify the decrypted data.
Don't try it, just do it!
|
|
|
|
|
In general compress first. Someone could design an encryption algorythm that also did compressions, but only the very smartest of people should attempt it, and even they should expect to take at least 5 years to design the algorythm. (even then success isn't a for sure thing, many algorythms seem good for 10 years or more until someone figgures out a trivial way to break it!)
|
|
|
|
|
I think the final decision will be based on
- how frequent the compression and encryption functions be called
- the data itself, how secure does it need. And the lifetime of the data validity. Some data is only valid within a time frame, therefore, there is no need to apply complicated encryption that will only waste up the CPU time.
- the size of compressed data needed/acceptable..
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Hi i know this is probably a stupid question but whats the proper syntax for for allocating memory for a 2d array?
i tried
int **array;
array = new int[2][2]
even tried the second line with *array
this wont even compile
so wahts the correct way to do this?
thanks
|
|
|
|
|
The only way I know to do it is to create an array of int* and then assign each element to point to an array.
e.g.
int ** array = new int*[2];
for (int i = 0; i < 2; i++)
{
array[i] = new int[2];
}
|
|
|
|
|
this is definitly the most silly way. for every new an entry in the heap will be created which will decrese the speed of your app dramatically if there are many fields for the array.
Don't try it, just do it!
|
|
|
|
|
Pft. Allocation of the array is not typically the source of speed overhead. Accessing array positions repeatedly is, and your way is no faster than mine. Mine is at least intuitive.
|
|
|
|
|
Why don't you use a vector instead? They are much safer and easier to handle...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
... and also one dimensional.
|
|
|
|
|
vector < vector < int > > Matrix;
and now you have a 2d array...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
I suppose that works, but ick. I guess if it does the job for you, though . . .
|
|
|
|
|
there is a much better and faster way!
int **array;
int i, j;
array = new int[4]; 2*2=4
for( i = 0; i < 2; i++ )
{
for( j = 0; j < 2; j++ )
{
array[i*2+j] = i;
}
}
this is the fastest way
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
this is the fastest way
Unless you have some metrics to support this, speed is probably going to be irrelevant.
Your approach has a major flaw; namely that it is not intuitive. Read my response here as to why array[i][j] is much preferred over array[i*2+j] .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Here's what I do :
<br />
<br />
void **Alloc2DArray( int xdim, int xitmsize, int ydim, int yitmsize )<br />
{<br />
int i;<br />
int x;<br />
void ** data;<br />
<br />
data = (void **)calloc( xdim, xitmsize );<br />
if( data == NULL )<br />
return NULL;<br />
for( x = 0; x < xdim; x++ )<br />
{<br />
data[x] = calloc( ydim, yitmsize );<br />
if( data[x] == NULL )<br />
{<br />
for( i = 0; i < x; i++ )
free( data[i] );<br />
free( data );<br />
return NULL;<br />
}<br />
}<br />
<br />
return data;<br />
}<br />
<br />
<br />
<br />
void **Free2DArray( void **array, int xdim )<br />
{<br />
int x;<br />
<br />
if( array == NULL )<br />
return NULL;
<br />
for( x = xdim - 1; x >= 0; x-- )<br />
{<br />
free( array[x] );<br />
array[x] = NULL;<br />
}<br />
free( array );<br />
return NULL;<br />
}<br />
<br />
<br />
<br />
float **AllocFloatMatrix( int xdim, int ydim )<br />
{<br />
float **data = (float **)Alloc2DArray( xdim, sizeof( float * ),<br />
ydim, sizeof( float ) );<br />
return data;<br />
}<br />
<br />
<br />
<br />
float **FreeFloatMatrix( float **array, int xdim )<br />
{<br />
Free2DArray( (void **)array, xdim );<br />
return NULL;<br />
}<br />
Note that this is for old, straight C-style allocation and deallocation. You can change things to use new/delete fairly easily. This could also be adapted to a template implementation if one were so inclined.
Using the "type **" mechanism for allocation allows one to write variable[y][x] to access data which I find that to be reasonably clean.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
im very new to c++ and i cant find anything on adding just the date to a statusbar i dont want a datetimepicker i want just the date like sun may 23 2004i have
CTime t1;
t1=CTime::GetCurrentTime();
m_bar.SetPaneText(1,t1.Format("%H:%M:%S"));
for the time can someone help?
|
|
|
|
|
i want just the date like sun may 23 2004
>
CTime Tm;
Tm = Tm.GetCurrentTime();
CString strDate = Tm.Format( "%A, %B %d, %Y" );
|
|
|
|
|
thanks *Dreamz
|
|
|
|
|
Try using
   t1.Format("%c")
for the date and time with local formatting or
   t1.Format("%a %b %d %Y)
for "Sun May 23 2004"
For other options see documentation for the strftime function
|
|
|
|
|
thanks Martin Turnidge
|
|
|
|