|
I will talk to u after i will Do it..
until bye
krishnadk
|
|
|
|
|
krishnadevank wrote:
How is this idea
Put some metrics together and you'll have your answer. Only empirical testing will tell you if the algorithm is sound or not.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hai DavidCrow .
Can u explain it . It will help me.
so pls do it
bye
krishnadk
|
|
|
|
|
krishnadevank wrote:
Can u explain it .
Didn't you already explain it here?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Ok you found the difference how are you going to regenrate the original text,
So according to your logic "ABCDEF" will be compressed to "11111".
??? Any sense ?
God is Real, unless declared Integer.
|
|
|
|
|
From what i understood it will be
A11111
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
ok you are rite. the output will be A111 and it is good as long as the difference is positive,
This logic will take a beating if the difference it negative.
plus maximum difference is 25 i.e Z-A so you will end up allocating as many bits as for each alphabets i.e 6 bits if you are not using variable bit rate.
so its out of the window.
God is Real, unless declared Integer.
|
|
|
|
|
i agree that's why from the start i said it was a simple substitution unless applied to a large alphabet in order to gain something
The idea is not new, it dates since Sir Bacon whose cipher was based on Cesar cypher plus a changing offset at each next character.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
ABCDEF is not compressed to 11111
it like 12345. understand
krishnadk
|
|
|
|
|
|
Hi!.
I have an object, a big object, with many arrays of others object, so, I have problems when I serialize this object, because it seems that is not stored on disc completely.
There is a limit of size, of the object, to serialize?. That is, "more than xxx bytes are not possible to be stored in a single object".
'Cause I trace the serialization process, (both, store and load), and first, when the object is being stored, I see the values of the fields going to the CArchive object through the operator << :
if(ar.IsStoring)
ar<<field1<<field2; <---="" this="" line
...
and="" they="" are="" the="" right="" values,="" (numbers).
but="" when="" i="" trace="" same="" method,="" want="" to="" read="" from="" file="" object,="" values="" that="" see="" allways="" 0.
...
else
ar="">>field1>>field2; <-- this line
...
I can load a part of the object well, but other no.
All the data to serialize are of type long.
I don't know if the problem is when I try to save the data, (that it seems to be correct, 'cause there are not errors and I can see the right values going to CArchive), or when I try to read the data, (that also it seems to be correct, but nevertheless is not it 'cause I load allyaws 0).
Thank you.
|
|
|
|
|
Can u post your Serialize Method, I think it will help to answere you.
thanks
|
|
|
|
|
Hi!.
Ok, this is the serialize method of the object that have problems when I read:
<br />
void CTabla::Serialize(CArchive& ar)<br />
{<br />
<br />
TRACE(_T("Serialize of CTabla\n"));<br />
<br />
CObject::Serialize(ar);<br />
if(ar.IsStoring())<br />
{<br />
ar<<cantidadCodigos<<idTabla; ->here I see the right values<br />
}<br />
else<br />
{<br />
ar>>cantidadCodigos>>idTabla; <- but here I get always 0<br />
}<br />
<br />
m_Codigos->Serialize(ar); <br />
<br />
}<br />
I have a object called CDecDatabase that have an array of objects CMarcas. CMarcas have three arrays: an array of CSistemas, (that also have arrays of other objects, but that work fine), an array of CTabla and an array of CCategorias.
I have write, up there, the Serialize method of CTabla, when I have problems at the time to load.
I have see the file generate with an hexe editor and I saw that the data has been write, but I can't still load it, I get always 0.
Thank you for your support.
|
|
|
|
|
The problem might be with the << and >> overloads for the classes your are serializing. If as you say the data is being written correctly, have a look at the code in your >> operator.
Its also worth considering just writing a Serialize function for each class then you can call it from the main objects serialize (rather than having to use >> and << e.g.
CClass1::Serialize(CArchive& ar)
{
member1.Serialize(ar); // Serialise class members that are objects
member2.Serialize(ar);
if(ar.IsStoring()) // Seialise non-objects
{
ar << m_longvariable;
}
else
{
ar >> m_longvariable;
}
{
|
|
|
|
|
Hi.
I don't have written overload operators << and >> I just use these operators from CArchive when a I must serialize a non object members, (long), and every array of objects that I have, (in the main object), it call the Serialize method of the Object that, in some cases, it have others array of objects plus non objects members, and in other cases just non object members.
Anonymous wrote:
Its also worth considering just writing a Serialize function for each class then you can call it from the main objects serialize (rather than having to use >> and << e.g.
I'm doing that.
Maybe, sometimes, at the moment of store, there is some kind of "detail" that make a little shift of data, so when I try to load the data, part of it might load it well, but the part that have been shifted doesn´t.
I have verify the order of serialization and I think that it's correct, always the same order.
That's my problem.
Thank you very much
|
|
|
|
|
Hi.
I don't have written overload operators << and >> I just use these operators from CArchive when a I must serialize a non object members, (long), and every array of objects that I have, (in the main object), it call the Serialize method of the Object that, in some cases, it have others array of objects plus non objects members, and in other cases just non object members.
Anonymous wrote:
Its also worth considering just writing a Serialize function for each class then you can call it from the main objects serialize (rather than having to use >> and << e.g.
I'm doing that.
Maybe, sometimes, at the moment of store, there is some kind of "detail" that make a little shift of data, so when I try to load the data, part of it might load it well, but the part that have been shifted doesn´t.
I have verify the order of serialization and I think that it's correct, always the same order.
That's my problem.
Thank you very much
|
|
|
|
|
Hi everyone!
I am working with a connection to a MS-SQL server in C++ and use ADO. But I can not make it work like I want to!
I want to use SQL-statment in my code, and there are 2 statment I need, INSERT and UPDATE. I have tried my code with an ACCESS database it worked perfect. When I changed to MS-SQL it stopped when I try to INSERT. Update is not tryed yet.
Hope someone can help me with this, or have some examples...;)
My source is:
::CoInitialize(NULL);
// Use ODBC
_ConnectionPtr ptrConn("ADODB.Connection");
// Make the connection
ptrConn->Open(L"Provider=MSDASQL.1;Data Source=data", L"user", L"password", adConnectUnspecified);
// Pointer to the database
_CommandPtr ptrCmd("ADODB.Command");
// Activate the connection
ptrCmd->ActiveConnection = ptrConn;
// Create a recordset
_RecordsetPtr ptrRs("ADODB.Recordset");
ptrRs->PutRefSource(ptrCmd);
// Create a SQL-statment (nnavn, snavn, gruppe and navn is CString)
sql = "INSERT INTO opc (datamaskin, server, gruppe, tagnavn) VALUES ('" + nnavn + "', '" + snavn + "', '" + gruppe + "', '" + navn + "')";
// Create a char[] of CString (Maybe I dont need this..)
strncpy (buf, sql, 200);
// Execute SQL
ptrRs->Open(buf, ptrConn.GetInterfacePtr(), adOpenForwardOnly, adLockReadOnly, adCmdText);
// Close the database
ptrConn->Close();
CoUninitialize();
Andreas
|
|
|
|
|
I am not exactly sure what your problem is. I do use ADO and MS-SQL server all the time without problems. Here is a link to a very good class that makes ADO a lot easier to use:
http://www.codeproject.com/database/caaadoclass1.asp[^]
Wait a minute, I think I have found the problem.
ptrConn->Open(L"Provider=MSDASQL.1;Data Source=data", L"user", L"password", adConnectUnspecified);
I beleive there are two problems with this line as you do not specify the server or the database you want to use.
Here is the connection string that I use to connect to one of my databases:
CString strConnect("Provider=sqloledb;Data Source=(local);Initial Catalog=MageeMammoSQL;User Id=XX; Password=XX;");
hr = connection->Open(
_bstr_t(strConnect),
_bstr_t(L""),
_bstr_t(L""),NULL);
In my case the server is (local) meaning the current pc. And the database on the server is MageeMammoSQL
John
|
|
|
|
|
If your program works in the JET engine (MS Access), but not in SQL Server, then that suggest a difference in the SQL statement between the two systems.
andysmurfen wrote:
sql = "INSERT INTO opc (datamaskin, server, gruppe, tagnavn) VALUES ('" + nnavn + "', '" + snavn + "', '" + gruppe + "', '" + navn + "')";
for example:
By default the string qualifier for SQL Server is ', not a ", as it is in Access.
try using this for your SQL Server connection and see if it works
I Dream of Absolute Zero
|
|
|
|
|
Hello,
how can i draw an image that would be transparent? which means will get the background of where it is drawn....
this is the code i use to draw the image:
HBITMAP hBmp = pDlgInf->GetBmp();
CPoint pnt(rc.left + SPACE_WIDTH / 5,rcText.top);
CSize size(IMAGE_DIMENTIONS,IMAGE_DIMENTIONS);
pDC->DrawState(pnt,size,hBmp,DST_BITMAP);
i see the image fine, but it is not transparent...the transparent color (0,128,128) is shown there...
can any1 help?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
DrawState can draw transparent icons only. To draw a transparent bitmap, use the ::TransparentBlt function.
|
|
|
|
|
Thanks for the reply,
i tried to use TransparentBlt, and i saw the image as transparent, but i got an other problem , if i moved the dialog outside the screen boundaries and then drag it back in, the image was fundged....it didn't appear well.
can u help?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Well... all I think is that you should redraw your bitmap properly, that is, first clear the background and then blitting an image. Use clipping information in PAINTSTRUCT for proper paiting. And try to use double buffering.
|
|
|
|
|
I need to make CDateTimeCtrl not editable, without arrows ?
<br />
m_Planer.m_Current_Date .ModifyStyle(0, DTS_SHORTDATEFORMAT);<br />
m_Planer.m_Current_Time .ModifyStyle(0, DTS_TIMEFORMAT);<br />
not works:
<br />
m_Planer.m_Current_Date .ModifyStyle(DTS_UPDOWN | DTS_APPCANPARSE ,0 );<br />
How to do subject?
thanks
|
|
|
|
|
Hey! You can subclass this control and listen for WM_KEYDOWN message
codes of arrows
VK_LEFT (25)
LEFT ARROW key
VK_UP (26)
UP ARROW key
VK_RIGHT (27)
RIGHT ARROW key
VK_DOWN (28)
DOWN ARROW key
<br />
switch (uiMsg)<br />
{<br />
case WM_KEYDOWN:<br />
{<br />
if(wParam>= VK_LEFT && wParam<=VK_RIGHT)<br />
return 0;<br />
}<br />
<br />
}<br />
try to read something on subclusing on msdn
and probably in this article you will find usefull info
Pain is a weakness living the body
|
|
|
|
|