|
Are you able to solve this problem on paper? Remember that a computer can't do anything you didn't tell it to do. If a 'space' surrounded by 1 s means something, that can easily be searched for. If a series of four (or five) 0 s is special, that too can be searched for. Work this out on paper and the code will (almost) fall into place.
sinbear wrote: ...this file will be print out in txt format...
How is this important (to the problem)?
sinbear wrote: ...it is the birnary format...
Which means what exactly?
sinbear wrote: the two exceptional 1 E is locate at:
This is all but meaningless. Please clarify.
sinbear wrote: ...the group of 1...
What is a "group of 1?"
Plenty of questions have been asked of you but I've yet to see you respond with any clarification. People are willing to help, but only if you can present them with a good understanding of what you want.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Are you really trying to get some help on this? From the way you present the problem I would guess not... :-P
Rilhas
|
|
|
|
|
no, i really need a help on this problem, but just because quite hard to describe here, as it is a Genetic algorithm problem...,in the format i type, i try to make yours understand, but look like quite hard to do so, so no choice, i have to give up le..
|
|
|
|
|
I would like to check whether the file exists before reading it, however the ios::good flag and ios::bad do not seem to flag the expected values and the program is crashing...
bool CSentenceList::readFile(const char strFileToRead[MAX_FILENAME_LENGTH + 1])
{
char strLine[MAX_SENTENCE_LENGTH];
fstream fileToRead(strFileToRead,ios::in);
if (ios::good != false) // what does this check?
{while (!fileToRead.eof() && Size < MAX_LINES)
{ fileToRead.getline(strLine, MAX_SENTENCE_LENGTH);
if (strlen(strLine) > 0)
{ Sentences.push_back(strLine);
Size++;
}
}
return true;
}
else
{ throw "File cannot be read!";
return false;
}
fileToRead.close();
}
Jon
|
|
|
|
|
ios::good is always "good".
You need to check "if(fileToRead)" at that point.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
strFileToRead holds a valid value at that point, the problem seems to be that ios::good validates to 'true', even though the file does not exist for example. This problem only happened with this program (one-off), so I was wondering what was wrong with the code.
Jon
-- modified at 7:55 Friday 8th September, 2006
|
|
|
|
|
Hi,
anyone know how to detect mouse click in the child window created using CHTMLEDITVIEW (base class) MFC VC++.NET 2003
I can only detect mouse click in the client area but not the child window.
seek help urgently.
tks,
terr
|
|
|
|
|
Hi,
I'm almost sure this will help you
<a href="http://support.microsoft.com/kb/q133716/">http:
Only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
tks for the response for my query.
However, the link u provided me, i have tried before.
It only subclass the client area of the Main Frame. And I can detect mouse clicks from the main frame but not the child window.
i.e. when i use "FILE -> OPEN -> "powerpoint.ppt " ( child window ), when i tried to detect the mouse clicks in this child window (MDIChildWnd), it does not detect at all.
Do you have any idea? I search through all sources and i could not find any solutions.
awaiting for your reply.
Thanks
terr
terr
|
|
|
|
|
Hi,
I was implementated TWAIN interface in ActiveX control.
I send message PreTranslateMessage to the
ActiveX from Main application (necessary for correct TWAIN functionality).
Problem is that after closed Main application this fallen (
"delete pThread->m_pMessageFilter;"
)
Is correct to use TWAIN interface in ActiveX control???
Thanks
|
|
|
|
|
Hello,
I use Visual C++ 7.1 on the base of Visual Studio .NET 2003 SP1 on Windows XP.
I want to launch a script as pre-build step which call SubWCRev.exe from TortoiseSVN. I surprisingly noted that this program can not be called because its path is not found. I checked the PATH environment variable: C:\Programme\TortoiseSVN\bin is in it, and SubWCRev can be executed from the console window. I executed path > toto.txt in the pre-build command line and noted that the result is false: the path of TortoiseSVN is not there and a path removed yesterday (several reboots in between) is still present!
I already posted another manifestation of this problem: System PATH not recognised in pre-build step?
Does anyone have an explanation?
Is there a way to fix that problem?
Thanks in advance for your light!
Nolyann
|
|
|
|
|
Hi all,
I am working on an e-mail client application
I've planned to store every email as *.eml file in the user's appropriate folder (physically created folder like Inbox, Sent Items etc) in HDD
and keeps an *.MDB (CDaodatabase) with fields like
folder, from, to, subject, emlfilepath, emlfilename
So I can query the DB for fast retrieval and when user click/select a mail than open
the eml file and show the mail content on the preview pane
Is this a right way for the e-mail client storage OR any suggestions appreciated
-- modified at 6:06 Wednesday 27th September, 2006
|
|
|
|
|
Your idea is not very secure. Keeping emails on the HD like that leaves them wide open for people to read. I suggest you implement some sort of encryption. Also, as a user, I would not like individual emails to be stored in this way (even if they are encrypted). It shows people how many emails I have, and roughly when I recieved them, again not very secure.
What I would like though, an encrypted container. Take a look at 'Jetico Bestcrypt'; or a form of password protect filesystem. Either of these would make it easy for you to store .eml files, and keep it secure.
|
|
|
|
|
waldermort, thanks for the point
I’ll lookout for encrypting the mails
If performance concerned, Is it ok to go with MDB/*.eml(encrypted)OR with single custom database file format like outlook express
thanks in advance
|
|
|
|
|
I have written an email client and I stored files in mbox format - each "folder" consists of a single file, which is plain text and contains all the email messages delimited with "From - date". I maintain a separate binary index file for each "folder" that contains a list of messages and their position in the main mbox file (and other useful information such as the message size, common header fields like To, From, Subject, etc.). This isn't too far away from how Mozilla Thunderbird works.
|
|
|
|
|
thanks robert
Robert Edward Caldecott wrote: each "folder" consists of a single file, which is plain text and contains all the email messages delimited with "From - date". I maintain a separate binary index file for each "folder" that contains a list of messages and their position in the main mbox file
But we have to write our own parser(non buggy) for the Index and Mail file
I hope SQL queries in MDB gives more customizable(and faster) filters than our own file format
Robert Edward Caldecott wrote: This isn't too far away from how Mozilla Thunderbird works.
If MDB is not the right way to go Is there any Component/Library which handles the parsing for me ?
thanks again
|
|
|
|
|
Is there any MDB data VS (MS)XML data parsing/query/filtering performance review on the net ?
|
|
|
|
|
I want to save only three 1)EURUSD,2)USDJPY,3)GBPUSD
market data coming from remote server in a txt file .But in this code all the market data are saved.How to save only paricular data.
I have write a comment line before 'if' statement where i have problem for this.
<br />
void CWartz_newDlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) <br />
{<br />
<br />
<br />
sessionid=SessionId;<br />
CurrentRequestId=RequestId;<br />
CString MarketSt,a,b,c,d;<br />
<br />
a.Format("%d",MarketNo);<br />
b.Format("%c",BidDirection);<br />
c.Format("%c",AskDirection);<br />
iMarketNo=MarketNo;<br />
aMarketNo.Add(MarketNo);<br />
<br />
d.Format("%d",MarketState);<br />
<br />
m_MainEdit=m_MainEdit + "<Price Change>" + SessionId + "\t" + RequestId +"\t"+ a ; <br />
m_MainEdit=m_MainEdit + "\t"+ Market + "\t" + Bid + "\t" + b + "\t"+ Ask + "\t" +c +"\t"+ High + "\t";<br />
m_MainEdit=m_MainEdit + Low + "\t" + d +"\t" + Timestamp + "\r\n";<br />
<br />
UpdateData(FALSE);<br />
iLineCount=m_EditCtrl.GetLineCount();<br />
m_EditCtrl.LineScroll(iLineCount);<br />
<br />
<br />
<br />
<br />
if(Market="EURUSD",myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite))<br />
{<br />
<br />
LPSTR buf;<br />
int i = m_MainEdit.GetLength();<br />
buf = m_MainEdit.GetBuffer(i);<br />
myfile.Write(buf,i);<br />
myfile.Close();<br />
}<br />
}<br />
And like this way i have to make three txt file:
1)EURUSD.txt
2)USDJPY.txt
3)GBPUSD.txt
Thanks. Pls help me
-- modified at 4:51 Thursday 7th September, 2006
|
|
|
|
|
Pls use the below code......
CString csMarket = "EURUSD";
if( csMarket == Market )
{
myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite));
LPSTR buf;
int i = m_MainEdit.GetLength();
buf = m_MainEdit.GetBuffer(i);
myfile.Write(buf,i);
myfile.Close();
}
|
|
|
|
|
Sorry it is also saving all market detail.Do you have any other idea
|
|
|
|
|
maybe EURUSD is in all your data
|
|
|
|
|
No it is market name and for these whenever change in data in server side it will come.It is not in all.
I want to make three .txt file
1)EURUSD
2)USDJPY
3)GBPUSD
Thanks
|
|
|
|
|
if you run this line if(Market=="EURUSD")
whats happening?did you trace line to line your program?
|
|
|
|
|
WhiteSky wrote: if you run this line if(Market=="EURUSD")
whats happening?
The condition will never evaluate to TRUE.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
abrakadbra wrote: Sorry it is also saving all market detail.Do you have any other idea
So have you bothered to set a breakpoint on the if(csMarket == Market) statement to check the value of Market ? It may surprise you to find it is always equal to EURUSD.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|